﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">

<title>开心果</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="css/jquery.mobile-1.4.2.min.css" />
<link rel="stylesheet" type="text/css" href="css/mobiscrollcss/mobiscroll.custom-2.6.2.min.css">
<link rel="stylesheet" type="text/css" href="css/jkcss.css">
<script type="text/javascript" src="js/lib/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/mobiscroll.custom-2.6.2.min.js"></script>
<script type="text/javascript" src="js/lib/jquery.form.js"></script>
<script type="text/javascript" src="js/JKFunc.js"></script>
<script type="text/javascript" src="js/JKLogin.js"></script>
<script type="text/javascript" src="js/JKCheckForm.js"></script>
<script type="text/javascript" src="js/JKRegister.js"></script>
<script type="text/javascript" src="js/lib/jquery.mobile-1.4.2.min.js"></script>
<script type="text/javascript">
var storage;
var shopId;
var shopAdminId;
var maxDistance611;
var openTime616;
var closeTime616;
var fruitName;
var classID;
var isNew = false;
var isImport= false;
var description;
var fruitID;
var avgPrice, util, price, weight;
var arrAll = new Array();
var farr = new Array();
var sID;
var PageEvent="";
var subId614arr = new Array();
var sub614arr = new Array();
var telArr;
window.onload=function(){
	storage= window.localStorage;
	window.telArr = new Array(storage.getItem("telPhones"));
	window.shopId=storage.getItem("shopid");
	if(window.shopId==null){
		localStorage.clear();
		localStorage.setItem("telPhones",window.telArr);
		if("undefined" != typeof (mobile)){
			mobile.logout();
		}
		window.location.href="index.html";
	}
	window.shopAdminId = storage.getItem("shopAdminId");
	//window.shopId="33";
	window.maxDistance611 = storage.getItem("maxDistance");
	window.openTime611 = storage.getItem("openTime");
	window.closeTime611  = storage.getItem("closeTime");
	if("undefined" != typeof (mobile)){
		mobile.login(storage.getItem("LoginName"));
	}

	if(window.maxDistance611!=null){
		$("#maxdistance").val(window.maxDistance611);
		}else{
			$("#maxdistance").val("1");
		}
	if(window.openTime611!=null){
		$("#opentime616").val(window.openTime611);
		
		}
		if(window.closeTime611!=null){
	$("#closetime616").val(window.closeTime611);
		}
		
	getLastTime();
	getTodayOrder();
	var classArr = new Array();
	JKjsonP({
			ws:"merchants/listCategory",
			parameter:{},
			sFunc:function(json){
				if (json.result=="success"){
					var arr=json.data;
					var len=arr.length;
					for (var i=0;i<len;i++){
						var obj=arr[i];
						var classID = obj.id;
						var className = obj.name;
						var classMemo = obj.letter;
						var fruitClass = classMemo+","+classID+","+className;
						classArr.push(fruitClass);
						//classArr2.push(fruitClass);
					}
					classArr.sort();
					var len = classArr.length;
					
					for (var i=0;i<len;i++){
						var arr1 = String(classArr[i]).split(",");
						var classMemo = arr1[0];
						var classID = arr1[1];
						var className=arr1[2];
						window.arrAll.push(arr1);
						
						$('<li><a id="'+classID+'" href="#page_4_1_1" onClick="submitID(this.id)" >'+className+'</a></li>').insertAfter($("#classlist"+classMemo));
						$("#classlist"+classMemo).css("display","block");
						$('<li><a id="'+classID+'" href="#page_5_2_5" onClick="submitID(this.id)" >'+className+'</a></li>').insertAfter($("#classlist52"+classMemo));
						$("#classlist52"+classMemo).css("display","block");
					}
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				JKPprompt("#popup14",emessage);
			}
		});
		
		//var classArr2 = new Array();
//JKjsonP({
	//		ws:"merchants/listCategory",
		//	parameter:{},
			//sFunc:function(json){
				//if (json.result=="success"){
					//var arr=json.data;
					//var len=arr.length;
					//for (var i=0;i<len;i++){
						//var obj=arr[i];
//						var classID = obj.id;
	//					var className = obj.name;
		//				var classMemo = obj.letter;
			//			var fruitClass = classMemo+","+classID+","+className;
				//		
					//}
					//classArr2.sort();
//					var len = classArr2.length;
	//				
		//			for (var i=0;i<len;i++){
			//			var arr1 = String(classArr[i]).split(",");
				//		var classMemo = arr1[0];
					//	var classID = arr1[1];
						//var className=arr1[2];
						//window.arrAll.push(arr1);
						
						//$('<li><a id="'+classID+'" href="#page_5_2_5" onClick="submitID(this.id)" >'+className+'</a></li>').insertAfter($("#classlist52"+classMemo));
						//$("#classlist52"+classMemo).css("display","block");
				//	}
				//}
			//},
			//eFunc:function(XMLHttpRequest, textStatus, emessage){
				//alert(emessage);
			//}
		//});
		
		
		
		$("#page_5_2_5 ul").listview();
$("#page_5_2_5 ul").listview("refresh");
		
		
	


};

function getLastTime(){
	JKjsonP({
			ws:"merchants/getLastTime",
			parameter:{shopId:window.shopId},
			sFunc:function(json){
				if (json.result=="success"){
					var lastTime = json.data.lastTime;
					var serverTime = json.data.serverTime;
					$("#lastTime62").html(lastTime);
					var last = new Date(lastTime);
					var now = new Date(serverTime);
					if(last.getTime()-now.getTime() < 0){
						alert("您的使用期限已过，请续费后继续使用");
						localStorage.clear();
						localStorage.setItem("telPhones",window.telArr);
						window.location="index.html";
					}else if(last.getTime()-now.getTime() <= 259200000){
						alert("您的使用期限还剩下不到"+((last.getTime()-now.getTime())/86400000).toFixed(0)+"天，过期后将不能使用此软件，请及时续费");
					}
					}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				JKPprompt("#popup14",emessage);
			}
		});
}
function listFruitList(pageId){
	farr.length=0;
	$(".classList").remove();
	JKjsonP({
			ws:"merchants/listFruitList",
			parameter:{shopId:window.shopId},
			sFunc:function(json){
				if (json.result=="success"){
					var arr=json.data;
					var len=arr.length;
						for (var i=0;i<len;i++){
						var obj=arr[i];
						farr.push(obj);
						var classID = obj.classID;
						var className = obj.className;
						var classMemo=obj.classMemo;
						
						if(i==0){
						$('<li class="classList"><a id="'+classID+'"  onClick="searchID'+pageId+'(this.id)" style="color:#247f9f;" class="ui-btn ui-btn-icon-right ui-icon-carat-r">'+className+'</a></li>').insertAfter($("#classlist"+pageId+classMemo));
						$("#classlist"+pageId+classMemo).css("display","block");
						}else if(className!=arr[i-1].className){
							$('<li class="classList"><a id="'+classID+'"  onClick="searchID'+pageId+'(this.id)"  style="color:#247f9f;" class="ui-btn ui-btn-icon-right ui-icon-carat-r">'+className+'</a></li>').insertAfter($("#classlist"+pageId+classMemo));
						$("#classlist"+pageId+classMemo).css("display","block");
						}
						}
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				JKPprompt("#popup14",emessage);
			}
		});
	
	
	



}

function getTodayOrder(){
	$(".orderList31").remove();
	$("#status3_1_1").css("display","none");$("#status3_1_2").css("display","none");$("#status3_1_3").css("display","none");$("#status3_1_4").css("display","none");$("#status3_1_5").css("display","none");$("#status3_1_6").css("display","none");$("#status3_1_7").css("display","none");
	JKjsonP({
			ws:"merchants/listTodayOrder",
			parameter:{shopId:window.shopId},
			sFunc:function(json){
				if(json.result=="success"){
					for(var i = 0;i<json.data.length;i++){
					var orderId = json.data[i].orderId;
					var shipTime = json.data[i].shipStartTime+"-"+json.data[i].shipEndTime;
					var address = json.data[i].address;
					var status = json.data[i].status;
					var totalPrice = json.data[i].totalPrice;
					var order = "";
					if(status == "1"){
					order = '<li class = "orderList31" ><a onClick="go311(this.id)" id="'+orderId+'" data-transition="slide"><p>到货时间：'+shipTime+'</p><p>预计'+totalPrice+'元</p><p>到货地址：'+address+'</p></a></li>';
					
					}else if(status=="5"){
					order = '<li class = "orderList31" ><a onClick="go316(this.id)" id="'+orderId+'" data-transition="slide"><p>到货时间：'+shipTime+'</p><p>预计'+totalPrice+'元</p><p>到货地址：'+address+' </p></a></li>';
					}else{
					order = '<li class = "orderList31" ><a onClick="go312(this.id)" id="'+orderId+'" data-transition="slide"><p>到货时间：'+shipTime+'</p><p>总计'+totalPrice+'元</p><p>到货地址：'+address+' </p></a></li>';
					}
					$(order).insertAfter($("#status3_1_"+status)); 
					$("#status3_1_"+status).css("display","block");
					}
					
					$("#page_3_1 ul").listview();
					$("#page_3_1 ul").listview("refresh");
					$.mobile.changePage("#page_3_1",{transition:"slide"});
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
}



var anticipatedPrice = 0;
function go311(id){
	$("#no311").attr("hidden",true);
	 $("#orderFruitList311 *").remove();
	JKjsonP({
			ws:"merchants/getOrderDetail",
			parameter:{orderId:id},
			sFunc:function(json){
				if(json.result=="success"){
					$("#orderId311").val(id);
					var dateCreated = "下单时间："+json.data.dateCreated;
					$("#dateCreated311").html(dateCreated);
					var orderNo = json.data.orderNo;
					$("#orderNo311").html(orderNo);
					var mobilePhone = "手机号："+json.data.mobilePhone;
					$("#mobilePhone311").html(mobilePhone);
					var address = "到货地址："+json.data.address;
					$("#address311").html(address);
					var arrivalTime = "到货时间："+json.data.arrivalStartTime+"-"+json.data.arrivalEndTime;
					$("#arrivalTime311").html(arrivalTime);
					var fruitTotalPrice = "预估水果"+json.data.fruitTotalPrice+"元";
					$("#fruitTotalPrice311").html(fruitTotalPrice);
					var totalPrice = "预计："+json.data.totalPrice+"元";
					$("#totalPrice311").html(totalPrice);
					var shipPrice = "运费"+json.data.shipPrice+"元";
					$("#shipPrice311").html(shipPrice);
					var customerOrderFail = "发货后交易失败率"+json.data.customerOrderFail;
					$("#customerOrderFail311").html(customerOrderFail);
					var limitFlag = json.data.limitFlag;
					if(limitFlag){
						$("#no311").attr("hidden",false);
						window.anticipatedPrice = json.data.fruitTotalPrice;
					}
					var status = json.data.status;
					switch(status){
						case 1:
						status = "未处理";
						break;
						case 2:
						status = "已配货";
						break;
						case 3:
						status = "送货中";
						break;
						case 4:
						status = "已到货";
						break;
						case 5:
						status = "拒绝发货";
						break;
						case 6:
						status = "拒收";
						break;
						case 7:
						status = "已撤单";
						break;
					}
					$("#status311").html(status);
					
					for(var i = 0;i<json.data.fruits.length;i++){
						var orderDetailId = json.data.fruits[i].orderDetailId;
						var fruitId = json.data.fruits[i].fruitId;
						var fruitName = json.data.fruits[i].fruitName;
						var quantity = json.data.fruits[i].quantity;
						var util = json.data.fruits[i].util;
						var comment = json.data.fruits[i].comment;
						
						
      var fruit311 = '<br><div class="ui-grid-c" style="width:300px"><div class="ui-block-a" style="margin-top:10px;width:auto" > <span>'+fruitName+'</span>&nbsp;&nbsp;<span>'+quantity+util+'</span></div><div class="ui-block-a" style="margin-top:10px"><label for="fruitpice11" style="font-size:15px">价格：</label></div><div class="ui-block-c" style="width:70px;margin-left:-20px"><input type="text" id="'+orderDetailId+'" class="fruitpice311"></div><div class="ui-block-d" style="margin-top:10px;margin-left:20px" > <span>元</span> </div></div><span >要求：'+comment+'</span><br>';
	  $("#orderFruitList311").append(fruit311);
	  $("#page_3_1_1 div").trigger("create");
					}
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
	$.mobile.changePage("#page_3_1_1",{transition:"slide"});
}
function go312(id){
	$("#no312").attr("hidden",true);
	$("#orderFruitList312 *").remove();
	JKjsonP({
			ws:"merchants/getOrderDetail",
			parameter:{orderId:id},
			sFunc:function(json){
				if(json.result=="success"){
					$("#orderId312").val(id);
					var dateCreated = "下单时间："+json.data.dateCreated;
					$("#dateCreated312").html(dateCreated);
					var orderNo = json.data.orderNo;
					$("#orderNo312").html(orderNo);
					var mobilePhone = "手机号："+json.data.mobilePhone;
					$("#mobilePhone312").html(mobilePhone);
					var address = "到货地址："+json.data.address;
					$("#address312").html(address);
					var arrivalTime = "到货时间："+json.data.arrivalStartTime+"-"+json.data.arrivalEndTime;
					$("#arrivalTime312").html(arrivalTime);
					var fruitTotalPrice = "水果"+json.data.fruitTotalPrice+"元";
					$("#fruitTotalPrice312").html(fruitTotalPrice);
					var totalPrice = "总计："+json.data.totalPrice+"元";
					$("#totalPrice312").html(totalPrice);
					var shipPrice = "运费"+json.data.shipPrice+"元";
					$("#shipPrice312").html(shipPrice);
					var customerOrderFail = "发货后交易失败率"+json.data.customerOrderFail;
					$("#customerOrderFail312").html(customerOrderFail);
					var limitFlag = json.data.limitFlag;
					if(limitFlag){
						$("#no312").attr("hidden",false);
					}
					var status = json.data.status;
					switch(status){
						case 1:
						status = "未处理";
						break;
						case 2:
						status = "已配货";
						break;
						case 3:
						status = "送货中";
						break;
						case 4:
						status = "已到货";
						break;
						case 5:
						status = "拒绝发货";
						break;
						case 6:
						status = "拒收";
						break;
						case 7:
						status = "已撤单";
						break;
					}
					$("#status312").html(status);
					
					for(var i = 0;i<json.data.fruits.length;i++){
						var orderDetailId = json.data.fruits[i].orderDetailId;
						var fruitId = json.data.fruits[i].fruitId;
						var fruitName = json.data.fruits[i].fruitName;
						var quantity = json.data.fruits[i].quantity;
						var util = json.data.fruits[i].util;
						var totalPrice = json.data.fruits[i].totalPrice;
						var comment = json.data.fruits[i].comment;
						
						
      var fruit312 = '<br><div class="ui-grid-c" style="width:300px"><div class="ui-block-a" style="margin-top:10px;width:auto" > <span>'+fruitName+'</span>&nbsp;&nbsp;<span>'+quantity+util+'</span></div> <div class="ui-block-a" style="margin-top:10px;width:auto"> 价格：'+totalPrice+'元</div></div><span >要求：'+comment+'</span><br>';
	  $("#orderFruitList312").append(fruit312);
	  $("#page_3_1_2 div").trigger("create");
					}
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});	
$.mobile.changePage("#page_3_1_2",{transition:"slide"});
}
function go316(id){
	$("#no316").attr("hidden",true);
	$("#orderFruitList316 *").remove();
	JKjsonP({
			ws:"merchants/getOrderDetail",
			parameter:{orderId:id},
			sFunc:function(json){
				if(json.result=="success"){
					$("#orderId316").val(id);
					var dateCreated = "下单时间："+json.data.dateCreated;
					$("#dateCreated316").html(dateCreated);
					var orderNo = json.data.orderNo;
					$("#orderNo316").html(orderNo);
					var mobilePhone = "手机号："+json.data.mobilePhone;
					$("#mobilePhone316").html(mobilePhone);
					var address = "到货地址："+json.data.address;
					$("#address316").html(address);
					var arrivalTime = "到货时间："+json.data.arrivalStartTime+"-"+json.data.arrivalEndTime;
					$("#arrivalTime316").html(arrivalTime);
					var fruitTotalPrice = "预估水果"+json.data.fruitTotalPrice+"元";
					$("#fruitTotalPrice316").html(fruitTotalPrice);
					var totalPrice = "预计："+json.data.totalPrice+"元";
					$("#totalPrice316").html(totalPrice);
					var shipPrice = "运费"+json.data.shipPrice+"元";
					$("#shipPrice316").html(shipPrice);
					var customerOrderFail = "发货后交易失败率"+json.data.customerOrderFail;
					$("#customerOrderFail316").html(customerOrderFail);
					var limitFlag = json.data.limitFlag;
					if(limitFlag){
						$("#no316").attr("hidden",false);
					}
					var status = json.data.status;
					switch(status){
						case 1:
						status = "未处理";
						break;
						case 2:
						status = "已配货";
						break;
						case 3:
						status = "送货中";
						break;
						case 4:
						status = "已到货";
						break;
						case 5:
						status = "拒绝发货";
						break;
						case 6:
						status = "拒收";
						break;
						case 7:
						status = "已撤单";
						break;
					}
					$("#status316").html(status);
					
					for(var i = 0;i<json.data.fruits.length;i++){
						var orderDetailId = json.data.fruits[i].orderDetailId;
						var fruitId = json.data.fruits[i].fruitId;
						var fruitName = json.data.fruits[i].fruitName;
						var quantity = json.data.fruits[i].quantity;
						var util = json.data.fruits[i].util;
						var totalPrice = json.data.fruits[i].totalPrice;
						var comment = json.data.fruits[i].comment;
						
						
      var fruit316 = '<br><div class="ui-grid-c" style="width:300px"><div class="ui-block-a" style="margin-top:10px;width:auto" ><span>'+fruitName+'</span>&nbsp;&nbsp;<span>'+quantity+util+'</span> <div class="ui-block-a" style="margin-top:10px;width:auto"> 价格：'+totalPrice+'元</div></div><span >要求：'+comment+'</span><br>';
	  $("#orderFruitList316").append(fruit316);
	  $("#page_3_1_6 div").trigger("create");
					}
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});	
$.mobile.changePage("#page_3_1_6",{transition:"slide"});
}



function submitID(id){
	window.classID=id;
	for(var i=0;i<arrAll.length;i++){
		if(id==arrAll[i][1]){
		$("#className").html(arrAll[i][2]);	
		$("#className525").html(arrAll[i][2]);	
		}
	}
}



$(document).on("mobileinit", function(){
});
</script>
</head>

<body>
<div id="page_3_1" data-role="page" data-theme="d">
  <div data-role="header">
    <h1 class="ui-corner-all">订单管理</h1>
    <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px; background-color:#55C3F1">菜单</a> </div>
  <div data-role="content">
    <ul data-role="listview" >
      <li data-role="list-divider" id="status3_1_1" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">未处理</h2>
      </li>
      <li data-role="list-divider" id="status3_1_2" style="display:none" >
          <h2 style="float:left; margin-right:20px; color:#00CC66">已配货</h2>
      </li>
      <li data-role="list-divider" id="status3_1_3" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">送货中</h2>
      </li>
      <li data-role="list-divider" id="status3_1_4" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">已到货</h2>
      </li>
      <li data-role="list-divider" id="status3_1_5" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">拒绝发货</h2>
      </li>
      <li data-role="list-divider" id="status3_1_6" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">拒收</h2>
      </li>
      <li data-role="list-divider" id="status3_1_7" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">已撤单</h2>
      </li>
      
    </ul>
   
  </div>
  <div data-role="footer" data-position="fixed" style="border:none" data-tap-toggle="false">
  <p align="right" >
  <a class="ui-btn ui-corner-all" onClick="getTodayOrder()" data-rel="popup" style="background-color:#55C3F1">刷新</a>
<a class="ui-btn ui-corner-all" href="#page_3_1_8" data-rel="popup" style="margin-right:20px;background-color:#55C3F1">查看历史订单</a>
</p>
</div>
<div data-role="popup" id="page_3_1_8" data-theme="c" style="background:#333">
	<div data-role="content">
    	<div class="ui-grid-a" >
        	<div class="ui-block-b" style="width:40%;" >
            <input type="text" id="searchYear318" placeholder="年" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="4">
            </div>
            <div class="ui-block-b" style="width:25%;margin-left:5pt" >
            <input type="text" id="searchMonth318" placeholder="月" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="2">
            </div>
            <div class="ui-block-b" style="width:25%;margin-left:5pt" >
            <input type="text" id="searchDay318" placeholder="日" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="2">
            </div>
        </div>
        <p align="center"><a data-role="button" onClick="getHistoryOrder(318)" style="background-color:#55C3F1">查询</a></p>
    </div>
</div>
</div>
<script type="text/javascript">
function getHistoryOrder(id){
	$(".orderList319").remove();
	$("#status3_1_9_1").css("display","none");$("#status3_1_9_2").css("display","none");$("#status3_1_9_3").css("display","none");$("#status3_1_9_4").css("display","none");$("#status3_1_9_5").css("display","none");$("#status3_1_9_6").css("display","none");$("#status3_1_9_7").css("display","none");
	var day = $("#searchYear"+id).val()+"年"+$("#searchMonth"+id).val()+"月"+$("#searchDay"+id).val()+"日";
	JKjsonP({
			ws:"merchants/listOrderByDate",
			parameter:{shopId:window.shopId, date:day},
			sFunc:function(json){
				if(json.result=="success"){
					for(var i = 0;i<json.data.length;i++){
					var orderId = json.data[i].orderId;
					var shipTime = json.data[i].shipStartTime+"-"+json.data[i].shipEndTime;
					var address = json.data[i].address;
					var status = json.data[i].status;
					var totalPrice = json.data[i].totalPrice;
					var order = "";
					if(status == "1"){
					order = '<li class = "orderList31" ><a onClick="go311(this.id)" id="'+orderId+'" data-transition="slide"><p>到货时间：'+shipTime+'</p><p>预计'+totalPrice+'元</p><p>到货地址：'+address+'</p></a></li>';
					
					}else if(status=="5"){
					order = '<li class = "orderList31" ><a onClick="go316(this.id)" id="'+orderId+'" data-transition="slide"><p>到货时间：'+shipTime+'</p><p>预计'+totalPrice+'元</p><p>到货地址：'+address+' </p></a></li>';
					}else{
					order = '<li class = "orderList31" ><a onClick="go312(this.id)" id="'+orderId+'" data-transition="slide"><p>到货时间：'+shipTime+'</p><p>总计'+totalPrice+'元</p><p>到货地址：'+address+' </p></a></li>';
					}
					$(order).insertAfter($("#status3_1_9_"+status)); 
					$("#status3_1_9_"+status).css("display","block");
					}
					
					$("#page_3_1_9 ul").listview();
					$("#page_3_1_9 ul").listview("refresh");
					$.mobile.changePage("#page_3_1_9",{transition:"slide"});
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
}
</script>

<div id="page_3_1_9" data-role="page" data-theme="d">
  <div data-role="header">
  <a class="ui-btn ui-corner-all "  data-rel="back">返回</a>
    <h1 class="ui-corner-all">历史订单</h1>
    <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px; background-color:#55C3F1">菜单</a> </div>
  <div data-role="content">
    <ul data-role="listview" >
      <li data-role="list-divider" id="status3_1_9_1" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">未处理</h2>
      </li>
      <li data-role="list-divider" id="status3_1_9_2" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">已配货</h2>
      </li>
      <li data-role="list-divider" id="status3_1_9_3" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">送货中</h2>
      </li>
      <li data-role="list-divider" id="status3_1_9_4" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">已到货</h2>
      </li>
      <li data-role="list-divider" id="status3_1_9_5" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">拒绝发货</h2>
      </li>
      <li data-role="list-divider" id="status3_1_9_6" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">拒收</h2>
      </li>
      <li data-role="list-divider" id="status3_1_9_7" style="display:none">
          <h2 style="float:left; margin-right:20px; color:#00CC66">已撤单</h2>
      </li>
      
    </ul>
  </div>
  <div data-role="footer" data-position="fixed" style="border:none" data-tap-toggle="false">
  <p align="right" >
  <a data-role="button" style="margin-right:20px;background-color:#55C3F1" onClick="getTodayOrder()">返回今日订单</a>
<a class="ui-btn ui-corner-all"  style="margin-right:20px;background-color:#55C3F1" data-rel="popup" href="#page_3_1_8_2">重新选择日期</a>
</p>
</div>
<div data-role="popup" id="page_3_1_8_2" data-theme="c" style="background:#333">
	<div data-role="content">
    	<div class="ui-grid-a" >
        	<div class="ui-block-b" style="width:40%;" >
            <input type="text" id="searchYear3182" placeholder="年" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="4">
            </div>
            <div class="ui-block-b" style="width:25%;margin-left:5pt" >
            <input type="text" id="searchMonth3182" placeholder="月" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="2">
            </div>
            <div class="ui-block-b" style="width:25%;margin-left:5pt" >
            <input type="text" id="searchDay3182" placeholder="日" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="2">
            </div>
        </div>
        <p align="center"><a data-role="button" onClick="getHistoryOrder(3182)" href="#page_3_1_9" style="background-color:#55C3F1">查询</a></p>
    </div>
</div>
</div>


<div data-role="page" id="page_3_1_1" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" onClick="cleanPrice()" data-icon="back" style="border:none; color:#FFFFFF">返回</a> 
  <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px; color:#FFFFFF">菜单</a>
    <h1 class="ui-corner-all">订单管理</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a" >
    <input type="hidden" id="orderId311"/>
       <div class="ui-block-a" style="font-size:15px;width:auto" >
        <p style="font-size:18px" id="dateCreated311"></p>
      </div>
      <div class="ui-block-b" align="right" style="margin-left:-30px">
        <p style="font-size:18px;margin-right:10px" id="status311"></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto" >
        <p ><span>订单号：</span><span id="orderNo311"></span></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p id="arrivalTime311"></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p id="mobilePhone311"></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p id="address311"></p>
      </div>
    </div>
    <hr>
    <div id="no311" hidden="true" style="color:#F00">实际价格不超过预计价格</div>
    <div id="orderFruitList311" style="font-size:15px">
     
        
</div>      
       <br>
      <br>
      <span id="fruitTotalPrice311"></span> <br>
      <span id="shipPrice311"></span> <br>
      <span id="totalPrice311"></span> <br>
      <span id="customerOrderFail311"></span> <br>
    <div class="ui-grid-a">
      <div class="ui-block-a"> <a class="ui-btn ui-corner-all" onClick="acceptOrder()">接受</a> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all" data-rel="popup" href="#refuse">拒绝</a> </div>
    </div>
  </div>
  <div data-role="popup" id="refuse" data-theme="b">
  	<div data-role="content">
    <p>确定拒绝？</p>
    <div class="ui-grid-a">
      <div class="ui-block-a"> <a class="ui-btn ui-corner-all" onClick="refuseOrder()">确定</a> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all" data-rel="back">返回</a> </div>
    </div>
    </div>
  </div>
</div>
<script type="text/javascript">
function cleanPrice(){
window.anticipatedPrice = 0;
}


function acceptOrder(){
	var realPrice = 0;
	var orderId = $("#orderId311").val();
	var fruits = "[";
	var items = $(".fruitpice311");
	for(var i = 0;i<items.length;i++){
		var detailId = items[i].id;
		var totalPrice = $(items[i]).val();
		realPrice += totalPrice;
		if(totalPrice ==""){
			$(items[i]).focus().select();
			return ;
		}else{
			fruits += '{"detailId":"'+detailId+'","totalPrice":'+totalPrice+'},';
		}
	}
	fruits = fruits.substring(0,fruits.length-1)
	fruits +="]";
	if(window.anticipatedPrice!=0&&realPrice > window.anticipatedPrice){
		alert("实际价格超过预计价格，请重新填写");
	}else{
	JKjsonP({
			ws:"merchants/acceptOrder",
			parameter:{orderId:orderId, fruits:fruits},
			sFunc:function(json){
				
				if(json.result=="success"){
					getTodayOrder();
					window.anticipatedPrice = 0;
				}else{
				alert(json.msg);
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});	
	}
}

function refuseOrder() {
var orderId = $("#orderId311").val();
JKjsonP({
			ws:"merchants/refuseOrder",
			parameter:{orderId:orderId},
			sFunc:function(json){
				
				if(json.result=="success"){
					getTodayOrder();
				}else{
				alert(json.msg);
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
}
</script>

<div data-role="page" id="page_3_1_2" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class=" ui-corner-all">订单管理</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a" >
    <input type="hidden" id="orderId312"/>
       <div class="ui-block-a" style="font-size:15px;width:auto" >
        <p style="font-size:18px" id="dateCreated312"></p>
      </div>
      <div class="ui-block-b" align="right" style="margin-left:-30px">
        <p style="font-size:18px;margin-right:10px" id="status312"></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto" >
        <p ><span>订单号：</span><span id="orderNo312"></span></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p id="arrivalTime312"></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p id="mobilePhone312"></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p id="address312"></p>
      </div>
    </div>
    <hr>
    <div id="no312" hidden="true" style="color:#F00">实际价格不超过预计价格</div>
    <div id="orderFruitList312" style="font-size:15px">
     
        
</div>      
       <br>
      <br>
     <span id="fruitTotalPrice312"></span> <br>
      <span id="shipPrice312"></span> <br>
      <span id="totalPrice312"></span> <br>
      <span id="customerOrderFail312"></span>  <br>
    </div>
  </div>
</div>
<div data-role="page" id="page_3_1_6" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back" style="color:#FFFFFF">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">订单管理</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a" >
    <input type="hidden" id="orderId316"/>
       <div class="ui-block-a" style="font-size:15px;width:auto" >
        <p style="font-size:18px" id="dateCreated316"></p>
      </div>
      <div class="ui-block-b" align="right" style="margin-left:-30px">
        <p style="font-size:18px;margin-right:10px" id="status316"></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto" >
        <p ><span>订单号：</span><span id="orderNo316"></span></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p id="arrivalTime316"></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p id="mobilePhone316"></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p id="address316"></p>
      </div>
    </div>
    <hr>
    <div id="no316" hidden="true" style="color:#F00">实际价格不超过预计价格</div>
    <div id="orderFruitList316" style="font-size:15px">
     
        
</div>      
       <br>
      <br>
     <span id="fruitTotalPrice316"></span> <br>
      <span id="shipPrice316"></span> <br>
      <span id="totalPrice316"></span> <br>
      <span id="customerOrderFail316"></span>  <br>
    <p align="center"><a class="ui-btn ui-shadow ui-corner-all " onClick="recoverOrder()">恢复发货</a></p>
  </div>
</div>
<script type="text/javascript">
function recoverOrder(){
	var orderId = $("#orderId316").val();
JKjsonP({
			ws:"merchants/recoverOrder",
			parameter:{orderId:orderId},
			sFunc:function(json){
				
				if(json.result=="success"){
					getTodayOrder();
				}else{
				alert(json.msg);
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
}
</script>


<div data-role="page" id="page_1_2_3" data-theme="jk">
  <div data-role="header" >
    <h1 class="ui-corner-all">送货状态</h1>
    <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a> </div>
  <div data-role="content">
    <div data-role="collapsible-set" style="width: 110%; color:#f00;border:none;" data-inset="false">
	  
	  
	  
	  
<!--
	  <div data-role="collapsible" style="border:solid 1px #fff;color:#f00;border:none;" align="left">
        <h1>送货端1：mike</h1>
        <ul data-role="listview">
          <li data-role="list-divider" style="background-color:#deebb5; ">
            <div style="overflow:hidden;">
              <p style="background-color:#deebb5;border-color:#FFFFFF;">
              <h2 style="float:left;" >1点-2点</h2>
              <h2 style="float:right; margin-right:20px; color:#00CC66">配送中</h2>
              </p>
            </div>
          </li>
          <li> 
          <a href="#page_1_2_4" data-transition="slide" style="background-color:#deebb5; border-color: #FFFFFF;">
          <div class="ui-grid-a" style="font-size:20px">
            <div class="ui-block-a">
              <p>到货时间：1点-2点</p>
            </div>
            <div class="ui-block-b" align="right">
              <p>价格28元</p>
            </div>
            <div class="ui-block-a" style="width:auto;margin-top:-20px">
              <p>到货地址：梅园三村 </p>
            </div>
            <div class="ui-block-a" style="width:auto;margin-top:-20px">
              <p>福山路111弄24号101室</p>
            </div>
          </div>
          <li><a href="#page_1_2_4" data-transition="slide" style="background-color:#deebb5;border-color:#FFFFFF;">
            <div class="ui-grid-a" style="font-size:20px">
              <div class="ui-block-a">
                <p>到货时间：1点-2点</p>
              </div>
              <div class="ui-block-b" align="right">
                <p>价格28元</p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>到货地址：梅园三村 </p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>福山路111弄24号101室</p>
              </div>
            </div>
          </li>
          </a>
          <li data-role="list-divider" style="background-color:#deebb5;border-color:#FFFFFF;">
            <div style="overflow:hidden;">
              <p>
              <h2 style="float:left;">1点-2点</h2>
              <h2 style="float:right; margin-right:20px; color:#00CC66">可发货</h2>
              </p>
            </div>
          </li>
          <li><a href="#page_1_2_5" data-transition="slide" style="background-color:#deebb5;border-color:#FFFFFF;">
            <div class="ui-grid-a" style="font-size:20px">
              <div class="ui-block-a">
                <p>到货时间：1点-2点</p>
              </div>
              <div class="ui-block-b" align="right">
                <p>价格28元</p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>到货地址：梅园三村 </p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>福山路111弄24号101室</p>
              </div>
            </div>
            </a></li>
          <li><a href="#page_1_2_5" data-transition="slide" style="background-color:#deebb5;border-color:#FFFFFF;">
            <div class="ui-grid-a" style="font-size:20px">
              <div class="ui-block-a">
                <p>到货时间：1点-2点</p>
              </div>
              <div class="ui-block-b" align="right">
                <p>价格28元</p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>到货地址：梅园三村 </p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>福山路111弄24号101室</p>
              </div>
            </div>
            </a></li>
        </ul>
      </div>





      <div data-role="collapsible">
        <h1>送货端2：jimmy</h1>
        <ul data-role="listview" >


          <li data-role="list-divider" style="background-color:#deebb5;border-color:#FFFFFF;">
            <div style="overflow:hidden;">
              <p>
              <h2 style="float:left;">1点-2点</h2>
              <h2 style="float:right; margin-right:20px; color:#00CC66">配送中</h2>
              </p>
            </div>
          </li>

          <li><a href="#page_1_2_4" data-transition="slide" style="background-color:#deebb5;border-color:#FFFFFF;">
            <div class="ui-grid-a" style="font-size:20px">
              <div class="ui-block-a">
                <p>到货时间：1点-2点</p>
              </div>
              <div class="ui-block-b" align="right">
                <p>价格28元</p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>到货地址：梅园三村 </p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>福山路111弄24号101室</p>
              </div>
            </div>
            </a></li>

          <li><a href="#page_1_2_4" data-transition="slide" style="background-color:#deebb5;border-color:#FFFFFF;">
            <div class="ui-grid-a" style="font-size:20px">
              <div class="ui-block-a">
                <p>到货时间：1点-2点</p>
              </div>
              <div class="ui-block-b" align="right">
                <p>价格28元</p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>到货地址：梅园三村 </p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>福山路111弄24号101室</p>
              </div>
            </div>
            </a></li>


          <li data-role="list-divider" style="background-color:#deebb5;border-color:#FFFFFF;">
            <div style="overflow:hidden;">
              <p>
              <h2 style="float:left;">1点-2点</h2>
              <h2 style="float:right; margin-right:20px; color:#00CC66">可发货</h2>
              </p>
            </div>
          </li>

          <li><a href="#page_1_2_5" data-transition="slide" style="background-color:#deebb5;border-color:#FFFFFF;">
            <div class="ui-grid-a" style="font-size:20px">
              <div class="ui-block-a">
                <p>到货时间：1点-2点</p>
              </div>
              <div class="ui-block-b" align="right">
                <p>价格28元</p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>到货地址：梅园三村 </p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>福山路111弄24号101室</p>
              </div>
            </div>
            </a></li>

          <li><a href="#page_1_2_5" data-transition="slide" style="background-color:#deebb5; border-color:#FFFFFF;">
            <div class="ui-grid-a" style="font-size:20px">
              <div class="ui-block-a">
                <p>到货时间：1点-2点</p>
              </div>
              <div class="ui-block-b" align="right">
                <p>价格28元</p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>到货地址：梅园三村 </p>
              </div>
              <div class="ui-block-a" style="width:auto;margin-top:-20px">
                <p>福山路111弄24号101室</p>
              </div>
            </div>
            </a></li>

        </ul>
      </div>
-->




    </div>
  </div>
</div>
<script type="text/javascript">
$(document).on("pageshow","#page_1_2_3",function(){
	JKjsonP({
		ws:"merchants/getDeliveryManCount",
		parameter:{},
		sFunc:function(json){
			if (json.result=="success"){
				if(json.data=="0"){
					alert("没有送货端被开启");
				}else{
				JKjsonP({
		ws:"merchants/listGroupDeliveryOrder",
		parameter:{
			'shopId': function(){return window.shopId;}
		},
		sFunc:function(json){
			if (json.result=="success"){
				var content = $("#page_1_2_3 div[data-role='collapsible-set']");
				var htmlContent = "", orderData = resetOrder(json.data), orders, hasOrder = false;

				for(var courier in orderData){
					hasOrder = true;
					orders = orderData[courier];
					var nickName = orders[0].nickName;
					htmlContent = htmlContent + '<div data-role="collapsible"><h1>送货端：' + nickName + '</h1>'
						+ '<ul data-role="listview" >';
					for(var i = 0; i < orders.length; i ++){
						htmlContent = htmlContent + '<li data-role="list-divider" style="background-color:#deebb5;border-color:#FFFFFF;">'
						+ '<div style="overflow:hidden;"><p><h2 style="float:left;">' + orders[i].startTime + '点-' 
						+ orders[i].endTime + '点</h2>'
						+ '<h2 style="float:right; margin-right:20px; color:#00CC66">' + getStatus(orders[i].status)
						+ '</h2></p></div></li>'
						+ '<li><a onClick="go124(' + orders[i].orderId + ', ' + orders[i].startTime 
						+ ', ' + orders[i].endTime + ', ' + orders[i].status + ')" style="background-color:#deebb5;border-color:#FFFFFF;">'
						+ '<div class="ui-grid-a" style="font-size:20px">'
						+ '<div class="ui-block-a"><p>到货时间：' + orders[i].startTime + '点-' + orders[i].endTime + '点</p></div>'
						+ '<div class="ui-block-b" align="right"><p>价格' + orders[i].totalPrice + '元</p></div>'
						+ '<div class="ui-block-a" style="width:auto;margin-top:-20px">'
						+ '<p>到货地址：' + orders[i].address.address + '</p></div>'
						+ '</div></a></li>';
					}
					htmlContent = htmlContent + '</ul></div>\n';
				}
				if(!hasOrder){
					alert('没有订单');
				}
				content.html(htmlContent);
				content.trigger("create");
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			JKPprompt("#popup14",emessage);
		}
	});
				
				}
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});
});
function getStatus(sid){
	if(sid == 1)
		return "队列中";
	else if(sid == 2)
		return "可发货";
	else if(sid == 3)
		return "配送中";
	else if(sid == 4)
		return "已到货";
	else if(sid == 5)
		return "拒绝发货";
	else if(sid == 6)
		return "拒收";
	else if(sid == 7)
		return "已撤单";
	else 
		return "未知的状态";
}
function resetOrder(json){

	if(json){
		for(var courier in json){
		}
	}
	return json;
}
function go124(oid, startTime, endTime, status){
	JKjsonP({
		ws:"merchants/getOrderDetail",
		parameter:{
			'orderId': oid
		},
		sFunc:function(json){
			if (json.result=="success"){
				$("#startTime124").html(startTime);
				$("#endTime124").html(endTime);
				$("#status124").html(getStatus(status));
				$("#orderId124").html(json.data.orderNo);
				$("#price124").html(json.data.totalPrice);
				$("#orderTime124").html(json.data.dateCreated);
				$("#mobile124").html(json.data.mobilePhone);
				$("#addr124").html(json.data.address);
				var fs = "", fsArray = json.data.fruits;
				for(var i = 0; i < fsArray.length; i++){
					fs = fs + '<div class="ui-grid-b" style="width:300px">'
					+ '<div class="ui-block-a" style="margin-top:10px">' + fsArray[i].fruitName + ' ' + fsArray[i].quantity
					+ fsArray[i].util + '</span> </div><div class="ui-block-b" style="margin-top:10px;margin-left:-40px"> 价格：</div>'
					+ '<div class="ui-block-c" style="margin-left:-50px;margin-top:10px"> ' + fsArray[i].totalPrice + '元 </div>'
					+ '</div><span >' + fsArray[i].comment + '</span> <br> <br>';
				}
				$("#fList124").html(fs);
				$("#fruitTotalPrice124").html(json.data.fruitTotalPrice);
				$("#shipPrice124").html(json.data.shipPrice);
				$("#totalPrice124").html(json.data.totalPrice);
				$("#customerOrderFail124").html(json.data.customerOrderFail);
			}
			$.mobile.changePage("#page_1_2_4",{transition:"slide"});
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			JKPprompt("#popup14",emessage);
		}
	});
}
</script>
<div data-role="page" id="page_1_2_4" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">送货状态</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a">
      <div class="ui-block-a" style="font-size:15px;width:auto; " >
        <p style="font-size:18px;"><span id="startTime124">1</span>点-<span id="endTime124">2</span>点</p>
      </div>
      <div class="ui-block-b" align="right" style="margin-left:70px">
        <p style="font-size:18px;margin-right:10px" id="status124">配送中</p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto" >
        <p>订单号：<span id="orderId124">20081010</span></p>
      </div>
      <div class="ui-block-b" align="right" style="font-size:15px;" >
        <p >价格：<span id="price124">80</span>元</p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p>下单时间：<span id="orderTime124">12：30</span></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p >到货时间：2点-3点</p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p >手机号：<span id="mobile124">13600000000</span></p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p >到货地址：<span id="addr124">港汇广场</span></p>
      </div>
    </div>
    <hr>
    <div style="font-size:15px" id="fList124"><!--
      <div class="ui-grid-b" style="width:300px">
        <div class="ui-block-a" style="margin-top:10px"> <span>苹果5斤</span> </div>
        <div class="ui-block-b" style="margin-top:10px;margin-left:-40px"> 价格： </div>
        <div class="ui-block-c" style="margin-left:-50px;margin-top:10px"> 20元 </div>
      </div>
      <span >要求：脆一点</span> <br>
      <br>-->
    </div>
    <div style="font-size:15px" id="total124">
      <span>实际水果<span id="fruitTotalPrice124">75</span>元</span> <br>
      <span>运费<span id="shipPrice124">5</span>元</span> <br>
      <span>实际总价<span id="totalPrice124">80</span>元</span> <br>
      <span>发货后交易失败率<span id="customerOrderFail124">0%</span></span> <br>
    </div>
  </div>
</div>
<script type="text/javascript">

</script>
<div data-role="page" id="page_1_2_5" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">送货状态</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a" >
      <div class="ui-block-a" style="font-size:15px;width:auto" >
        <p style="font-size:18px">1点-2点</p>
      </div>
      <div class="ui-block-b" align="right" style="margin-left:70px">
        <p style="font-size:18px;margin-right:10px" id="status125">可发货</p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto" >
        <p>订单号：20081010</p>
      </div>
      <div class="ui-block-b" align="right" style="font-size:15px;" >
        <p >价格：80元</p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p>下单时间：12：30</p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p >到货时间：2点-3点</p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p >手机号：13600000000</p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p >到货地址：港汇广场</p>
      </div>
      <div class="ui-block-a" style="font-size:15px;width:auto;margin-top:-30px" >
        <p >福山路111弄24号101室</p>
      </div>
    </div>
    <hr>
    <div style="font-size:15px" >
      <div class="ui-grid-b" style="width:300px">
        <div class="ui-block-a" style="margin-top:10px"> <span>苹果5斤</span> </div>
        <div class="ui-block-b" style="margin-top:10px;margin-left:-40px"> 价格： </div>
        <div class="ui-block-c" style="margin-left:-50px;margin-top:10px"> 20元 </div>
      </div>
      <span >要求：脆一点</span> <br>
      <br>
      <div class="ui-grid-b" style="width:300px">
        <div class="ui-block-a" style="margin-top:10px"> <span>菠萝5斤</span> </div>
        <div class="ui-block-b" style="margin-top:10px;margin-left:-40px"> 价格： </div>
        <div class="ui-block-c" style="margin-left:-50px;margin-top:10px"> 20元 </div>
      </div>
      <span >要求：甜一点</span> <br>
      <br>
      <div class="ui-grid-b" style="width:300px">
        <div class="ui-block-a" style="margin-top:10px"> <span>西瓜1个</span> </div>
        <div class="ui-block-b" style="margin-top:10px;margin-left:-40px"> 价格： </div>
        <div class="ui-block-c" style="margin-left:-50px;margin-top:10px"> 35元 </div>
      </div>
      <span >要求：甜一点</span> <br>
      <br>
      <span>实际水果75元</span> <br>
      <span>运费5元</span> <br>
      <span>实际总价80元</span> <br>
      <span>发货后交易失败率0%</span> <br>
    </div>
  </div>
</div>

<!--新品上架4.1.1-->
<div id="page_4_1_1" data-role="page" data-theme="jk">
  <div data-role="header">
    <h1 class="ui-corner-all">新品快速上架向导</h1>
    <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a> </div>
  <div data-role="content">
    <div class="ui-field-contain">
      <label for="infruitName411">填写具体水果名称：</label>
      <input type="text" name="infruitName411" id="infruitName411" onBlur="submit411()" >
    </div>
    <h3 id="fruitName411"></h3>
    <div class="ui-grid-b">
      <div class="ui-block-a">
        <h3 >种类:</h3>
      </div>
      <div class="ui-block-b" style="margin-left:-40px">
        <h3 id="className"></h3>
      </div>
      <div class="ui-block-c"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini"  href="#classlist" style="background-color:#55c3f1; color:#247f9f; position:absolute;left:50%">选择</a> </div>
    </div>
    <div class="ui-grid-a">
      <div class="ui-block-a">
        <input type="checkbox" name="new" id="new" >
        <label for="new" class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" style="background-color:#55c3f1; color:#247f9f;">新品上市</label>
      </div>
      <div class="ui-block-b">
        <input type="checkbox" name="import" id="import">
        <label for="import" class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" style="background-color:#55c3f1; color:#247f9f;">进口水果</label>
      </div>
    </div>
    <div class="ui-field-contain">
      <label for="fruitInfo">水果描述：</label>
      <textarea name="fruitInfo" id="fruitInfo"  ></textarea>
    </div>
    <div>
      <p style="text-align:center"><a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="submit46()" style="background-color:#55c3f1; color:#247f9f;">下一步</a> </p>
    </div>
  </div>
</div>

<!--4.6上传图片-->
<div data-role="page" id="page_4_6" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">图片预览</h1>
  </div>
  <div data-role="content">
    <h3 id="fruitName2"></h3>
    <div class="ui-grid-b">
      <div class="ui-block-a" >
        <p align="center">图1:</p>
        <p align="center"><img id="img0" style="max-width: 90px;max-height: 160px;"> </p>
      </div>
      <div class="ui-block-b">
        <p align="center">图2:</p>
        <p align="center"><img id="img1" style="max-width: 90px;max-height: 160px;"> </p>
      </div>
      <div class="ui-block-c" >
        <p align="center">图3:</p>
        <p align="center"><img id="img2" style="max-width: 90px;max-height: 160px;"></p>
      </div>
    </div>
    <div class="ui-grid-b">
      <div class="ui-block-a">
        <p align="center"><img id="img3" style="max-width: 90px;max-height: 160px;"></p>
        <p align="center">图4:</p>
      </div>
      <div class="ui-block-b">
        <p align="center"><img id="img4" style="max-width: 90px;max-height: 160px;"> </p>
        <p align="center">图5:</p>
      </div>
      <div class="ui-block-c">
        <p align="center"><img id="img5" style="max-width: 90px;max-height: 160px;"> </p>
        <p align="center">图6:</p>
      </div>
    </div>
    <div class="ui-grid-b">
      <div class="ui-block-a"> <a class="ui-btn ui-corner-all" href="#page_4_6_1" data-transition="slide">上传</a> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all" href="#page_4_6_2" data-transition="slide">删除</a> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all" onClick="submit461()" data-transition="slide">完成</a> </div>
    </div>
    
    <!--<div>
    <p style="text-align:center"><a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="submit461()" >下一步</a> </p>
  </div>--> 
  </div>
</div>
<script type="text/javascript">
var uploaded = false;
function afterUpload(v){
	if(uploaded){
		alert("上传完成");
		$('#file0').val("");
		$('#file1').val("");
		$('#file2').val("");
		$('#file3').val("");
		$('#file4').val("");
		$('#file5').val("");
		JKjsonP({
			ws:"merchants/getUploadResult",
			parameter:{
				'id': function(){return $('#fruitID').val();},
				'token': function(){return $('#token').val();}
			},
			sFunc:function(json){
				if (json.result=="success"){
					if(json.data && json.data.file0){
						$('#img0').attr("src", json.data.file0);
					}
					if(json.data && json.data.file1){
						$('#img1').attr("src", json.data.file1);
					}
					if(json.data && json.data.file2){
						$('#img2').attr("src", json.data.file2);
					}
					if(json.data && json.data.file3){
						$('#img3').attr("src", json.data.file3);
					}
					if(json.data && json.data.file4){
						$('#img4').attr("src", json.data.file4);
					}
					if(json.data && json.data.file5){
						$('#img5').attr("src", json.data.file5);
					}
					$.mobile.changePage("#page_4_6",{transition:"slide"});
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				JKPprompt("#popup14",emessage);
			}
		});
		uploaded = false;
	}
}
function aupload(){
	$("#upupup").popup("open");
	$('#token').val(new Date().getTime());
	$('#page_4_6_1_upload').attr('action', serverUrl + "merchants/upload");
	uploaded = true;
	$('#page_4_6_1_upload').submit();
}
$(document).on("pageshow","#page_4_6",function(){
	JKjsonP({
		ws:"merchants/getPics",
		parameter:{
			'id': function(){return $('#fruitID').val();}
		},
		sFunc:function(json){
			if (json.result=="success"){
				if(json.data && json.data.file0){
					$('#img0').attr("src", json.data.file0);
				}else{
					$('#img0').attr("src", "");
				}
				if(json.data && json.data.file1){
					$('#img1').attr("src", json.data.file1);
				}else{
					$('#img1').attr("src", "");
				}
				if(json.data && json.data.file2){
					$('#img2').attr("src", json.data.file2);
				}else{
					$('#img2').attr("src", "");
				}
				if(json.data && json.data.file3){
					$('#img3').attr("src", json.data.file3);
				}else{
					$('#img3').attr("src", "");
				}
				if(json.data && json.data.file4){
					$('#img4').attr("src", json.data.file4);
				}else{
					$('#img4').attr("src", "");
				}
				if(json.data && json.data.file5){
					$('#img5').attr("src", json.data.file5);
				}else{
					$('#img5').attr("src", "");
				}
				$.mobile.changePage("#page_4_6",{transition:"slide"});
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			JKPprompt("#popup14",emessage);
		}
	});
});

</script>
<div data-role="page" id="page_4_6_1" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">图片上传</h1>
  </div>
  <div data-role="content">
    <form id="page_4_6_1_upload" method="post" enctype="multipart/form-data" target="iupload">
      <h3 id="fruitName2"></h3>
      <input type="hidden" name="id" id="fruitID" value="">
      <input type="hidden" name="token" id="token" value="">
      <div >
        <label for="file0" >图1:</label>
        <input type="file" id="file0" name="file0" accept="image/gif,image/jpeg,image/png">
      </div>
      <div >
        <label for="file1" >图2:</label>
        <input type="file" id="file1" name="file1" accept="image/gif,image/jpeg,image/png">
      </div>
      <div >
        <label for="file2" >图3:</label>
        <input type="file" id="file2" name="file2" accept="image/gif,image/jpeg,image/png">
      </div>
      <div >
        <label for="file3" >图4:</label>
        <input type="file" id="file3" name="file3" accept="image/gif,image/jpeg,image/png">
      </div>
      <div >
        <label for="file4" >图5:</label>
        <input type="file" id="file4" name="file4" accept="image/gif,image/jpeg,image/png">
      </div>
      <div >
        <label for="file5" >图6:</label>
        <input type="file" id="file5" name="file5" accept="image/gif,image/jpeg,image/png">
      </div>
      <div>
        <p style="text-align:center"><a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onclick="aupload()" data-transition="slide">确定</a> </p>
      </div>
    </form>
    <iframe name="iupload" style="display:none" onload="afterUpload()"></iframe>
  </div>
  <div data-role="popup" id="upupup" data-theme="b" style="padding:10px">
  <img src="css/images/ajax-loader.gif" />正在上传，请稍候……
  </div>
</div>
<div data-role="page" id="page_4_6_2" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">图片删除</h1>
  </div>
  <div data-role="content">
    <h3 id="fruitName2"></h3>
    <form method="post" action="demoform.asp">
      <fieldset data-role="controlgroup">
        <legend>勾选图片删除：</legend>
        <div class="ui-grid-b">
          <div class="ui-block-a">
            <label for="delete1">图1</label>
            <input type="checkbox" name="delete462" id="delete51" value="file0" class="ui-corner-all">
          </div>
          <div class="ui-block-b">
            <label for="delete2">图2</label>
            <input type="checkbox" name="delete462" id="delete52" value="file1" class="ui-corner-all">
          </div>
          <div class="ui-block-c" >
            <label for="delete3">图3</label>
            <input type="checkbox" name="delete462" id="delete53" value="file2" class="ui-corner-all">
          </div>
        </div>
        <div class="ui-grid-b"> <br>
          <div class="ui-block-a">
            <label for="delete4">图4</label>
            <input type="checkbox" name="delete462" id="delete54" value="file3" class="ui-corner-all">
          </div>
          <div class="ui-block-b">
            <label for="delete5">图5</label>
            <input type="checkbox" name="delete462" id="delete55" value="file4" class="ui-corner-all">
          </div>
          <div class="ui-block-c">
            <label for="delete6">图6</label>
            <input type="checkbox" name="delete462" id="delete56" value="file5" class="ui-corner-all">
          </div>
        </div>
      </fieldset>
      <p style="text-align:center"><a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="deletePic()" href="" data-transition="slide" style="background-color:#55c3f1; color:#247f9f;">确定</a> </p>
    </form>
    <div> </div>
  </div>
</div>
<script type="text/javascript">

function deletePic(){
	var file0 = null;
	var file1 = null;
	var file2 = null;
	var file3 = null;
	var file4 = null;
	var file5 = null;
	if($("#delete51").attr("data-cacheval")=="false"){
		file0=1;
	}
	if($("#delete52").attr("data-cacheval")=="false"){
	file1=1;
	}
	if($("#delete53").attr("data-cacheval")=="false"){
	file2=1;
	}
	if($("#delete54").attr("data-cacheval")=="false"){
	file3=1;
	}
	if($("#delete55").attr("data-cacheval")=="false"){
	file4=1;
	}
	if($("#delete56").attr("data-cacheval")=="false"){
	file5=1;
	}
	JKjsonP({
		ws:"merchants/delFruitImage",
		parameter:{id:$('#fruitID').val(), file0:file0,file1:file1,file2:file2, file3:file3,file4:file4,file5:file5},
		sFunc:function(json){
			alert(json.msg);
			$.mobile.changePage("#page_4_6",{transition:"slide"});
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});
	
}
function submit411(){
	if($("#infruitName411").val()!=""){
	JKjsonP({
			ws:"merchants/checkFruitName",
			parameter:{name:$("#infruitName411").val(), shopId:window.shopId},
			sFunc:function(json){
				if(json.result=="success"){
					window.fruitName = $("#infruitName411").val();
					$("#fruitName411").html(window.fruitName);
	$("#fruitName46").html(window.fruitName);
	$("#fruitName43").html(window.fruitName);
				}else{
				alert(json.msg);
				$("#infruitName411").val("");
				$("#fruitName411").html("");
	$("#fruitName46").html("");
	$("#fruitName43").html("");
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
	}
}
</script> 
<script type="text/javascript">
var retWhere;
function submit46(){
	if($("#infruitName411").val()!=""){
	window.fruitName = $("#infruitName411").val();
	}else{
		alert("请填写具体水果名称");
		return;
	}
	if($("#className").html()!=""){
		if($("#new").is(':checked')){
		window.isNew =true;
	}else{
		window.isNew =false;
	}
	if($("#import").is(':checked')){
		window.isImport = true;
	}else{
		window.isImport = false;
	}
		}else{
			alert("请选择水果种类");
			return;
			}

	if($("#fruitInfo").val()!=""){
	window.description = $("#fruitInfo").val();
	
	$.mobile.changePage("#page_4_3",{transition:"slide"});

	
	//JKjsonP({
		//ws:"JKFTW_ShopInfo.asmx/AddFruit",
		//parameter:{shopid:window.shopId, FruitName:window.fruitName.HTMLEnCode(),classID:window.classID, isNew:window.isNew, isImport:window.isImport,Description:window.description},
		//sFunc:function(json){
			//alert(json[0]);
		//},
		//eFunc:function(XMLHttpRequest, textStatus, emessage){
			//alert(emessage);
		//}
	//});
	}else{
	alert("请输入水果描述");
	return;
	}
}


function submit461(){
	if(retWhere && retWhere != ''){
		$.mobile.changePage(retWhere,{transition:"slide"});
	}
}
</script> 
<!--水果列表-->
<div data-role="page" id="classlist" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">水果列表</h1>
  </div>
  <div data-role="content">
    <ul data-role="listview"   id="classList" >
      <li data-role="list-divider" id="classlistSG" style="display:none">水果拼盘</li>
      <li data-role="list-divider" id="classlistA" style="display:none">A</li>
      <li data-role="list-divider" id="classlistB" style="display:none">B</li>
      <li data-role="list-divider" id="classlistC" style="display:none">C</li>
      <li data-role="list-divider" id="classlistD" style="display:none">D</li>
      <li data-role="list-divider" id="classlistE" style="display:none">E</li>
      <li data-role="list-divider" id="classlistF" style="display:none">F</li>
      <li data-role="list-divider" id="classlistG" style="display:none">G</li>
      <li data-role="list-divider" id="classlistH" style="display:none">H</li>
      <li data-role="list-divider" id="classlistI" style="display:none">I</li>
      <li data-role="list-divider" id="classlistJ" style="display:none">J</li>
      <li data-role="list-divider" id="classlistK" style="display:none">K</li>
      <li data-role="list-divider" id="classlistL" style="display:none">L</li>
      <li data-role="list-divider" id="classlistM" style="display:none">M</li>
      <li data-role="list-divider" id="classlistN" style="display:none">N</li>
      <li data-role="list-divider" id="classlistO" style="display:none">O</li>
      <li data-role="list-divider" id="classlistP" style="display:none">P</li>
      <li data-role="list-divider" id="classlistQ" style="display:none">Q</li>
      <li data-role="list-divider" id="classlistR" style="display:none">R</li>
      <li data-role="list-divider" id="classlistS" style="display:none">S</li>
      <li data-role="list-divider" id="classlistT" style="display:none">T</li>
      <li data-role="list-divider" id="classlistU" style="display:none">U</li>
      <li data-role="list-divider" id="classlistV" style="display:none">V</li>
      <li data-role="list-divider" id="classlistW" style="display:none">W</li>
      <li data-role="list-divider" id="classlistX" style="display:none">X</li>
      <li data-role="list-divider" id="classlistY" style="display:none">Y</li>
      <li data-role="list-divider" id="classlistZ" style="display:none">Z</li>
       <li data-role="list-divider" id="classlistQT" style="display:none">其它</li>
    </ul>
  </div>
</div>
<div data-role="page" id="page_4_3" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">新品快速上架向导</h1>
  </div>
  <div data-role="content" >
    <h3 id="fruitName43"></h3>
    <h4>平均单位价格</h4>
    <div class="ui-grid-c" style="width:300px;" >
      <div class="ui-block-a" style="margin-top:15px;width:auto" >
        <label for="fruitpice43ge" >大概</label>
      </div>
      <div class="ui-block-b" style="width:50px;margin-left:10px" >
        <input type="text" id="fruitpice43ge">
      </div>
      <div class="ui-block-c" style="margin-top:15px;margin-left:10px" > <span>元/</span> </div>
      <div class="ui-block-d" style="margin-top:-5px;margin-left:-40px;width:100px" > <span>
        <select name="day" id="day" class=" ui-icon-arrow-d ui-btn-icon-left" style="width:100px">
          <option value="个">个</option>
          <option value="十个">十个</option>
          <option value="串">串</option>
          <option value="根">根</option>
          <option value="盒">盒</option>
        </select>
        </span> </div>
    </div>
    <h4>销售价格:</h4>
    <p>请填写</p>
    <div class="ui-grid-b" style="width:300px;" >
      <div class="ui-block-a" style="width:50px" >
        <input type="text" id="fruitpice43jin" onBlur="priceBlur(this)">
      </div>
      <div class="ui-block-b" style="margin-top:15px;margin-left:10px" align="left"> <span>元/斤</span> </div>
    </div>
    <p>或填写</p>
    <div class="ui-grid-c"  >
      <div class="ui-block-a" style="width:50px" >
        <input type="text" id="fruitpice43yuan" onBlur="priceBlur(this)">
      </div>
      <div class="ui-block-b" style="margin-top:15px;margin-left:10px" > <span>元</span> </div>
      <div class="ui-block-c" style="width:50px;margin-left:-50px" >
        <input type="text" id="fruitpice43njin" onBlur="priceBlur(this)">
      </div>
      <div class="ui-block-d" style="margin-top:15px;margin-left:10px" > <span>斤</span> </div>
      <div> </div>
    </div>
    <p align="center"><a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="submit43()" >下一步</a> </p>
  </div>
</div>
<script type="text/javascript">
function submit43(){
	if($("#fruitpice43ge").val()!=""){
		avgPrice = $("#fruitpice43ge").val();
	}else{
		alert("请填写平均单位价格");
		return;
	}
	if($("#day").val()!=""){
		util = $("#day").val();
	}else{
		util = "个";
	}
	if($("#fruitpice43jin").val()!=""){
		price = $("#fruitpice43jin").val();
		weight = '1';
	}else if($("#fruitpice43yuan").val()!="" && $("#fruitpice43njin").val()!=""){
		price = $("#fruitpice43yuan").val();
		weight = $("#fruitpice43njin").val();
	}else{
		alert("请认真填写销售价格");
		return;
	}

	JKjsonP({
		ws:"merchants/publish",
		parameter:{"name": window.fruitName, "categoryId": window.classID, "isNew": window.isNew, "isImport": window.isImport, "description": window.description, "avgPrice": window.avgPrice, "util": window.util, "price": window.price, "weight": window.weight, "shopId": window.shopId,"monthSales":0,"weekSales":0},
		sFunc:function(json){
			if (json.result=="success"){
				console.log("success");
				fruitID = json.data.id;
				$('#fruitID').val(fruitID);
				alert("水果信息保存成功。下一步，图片管理。");
				retWhere = "#page_4_1_1";
				$.mobile.changePage("#page_4_6",{transition:"slide"});
			} else {
				alert('水果名称已经存在。');
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert('提交失败');
		}
	});
}
function priceBlur(obj){
	if($(obj).attr("id") == 'fruitpice43jin'){
		if($.trim($(obj).val()) != ''){
			$("#fruitpice43yuan").val("").attr("disabled", true);
			$("#fruitpice43njin").val("").attr("disabled", true);
		}else{
			$("#fruitpice43yuan").attr("disabled", false);
			$("#fruitpice43njin").attr("disabled", false);
		}
	}
	
	if($(obj).attr("id") == 'fruitpice43yuan' || $(obj).attr("id") == 'fruitpice43njin'){
		if($.trim($("#fruitpice43yuan").val()) != '' || $.trim($("#fruitpice43njin").val()) != ''){
			$("#fruitpice43jin").val("").attr("disabled", true);
		}else{
			$("#fruitpice43jin").attr("disabled", false);
		}
	}
}

function getImport(pageId){
		var newPid = '';
		if(pageId == '521'){
			newPid = '522';
		}
		$("#fruitList" + newPid + " li").remove();
		JKjsonP({
			ws:"merchants/listFruitByIsImport",
			parameter:{shopId:window.shopId},
			sFunc:function(json){
				if(json.result=="success"){
					var fruitArr = json.data;
					var len = fruitArr.length;
					if(len==0){
						alert("没有搜索到水果");
					}else{
						for(var i = 0;i<len;i++){
							var fruitId511 = fruitArr[i].id;
							var name511 =  fruitArr[i].name;
							var grade511 = fruitArr[i].grade;
							if(grade511==null){
								grade511=2.5;
							}
							var avgPrice511 = fruitArr[i].avgPrice;
							var util511 = fruitArr[i].util;
							var price511 = fruitArr[i].price;
							var weight511 = fruitArr[i].weight;
							if(weight511=="1"){
								weight511="/";
							}
							var weekSales511 = fruitArr[i].weekSales;
							
							var monthSales511 = fruitArr[i].monthSales;
							var obj = '<li><a id="'+fruitId511+'"  onClick="searchFruit' + (pageId + 1) + '(this.id)"><div class="ui-grid-b"><div class="ui-block-a" style="margin-top:10px"><p style="font-size:20px">'+name511+'</p></div><div class="ui-block-b" style="font-size:20px;width:auto"><p >挑 '+grade511+'</p><p >'+price511+'元'+weight511+'斤 '+avgPrice511+'元/'+util511+'</p><p >周销量'+weekSales511+'斤 月销量'+monthSales511+'斤</p> </div></div> </a></li>';
							$("#fruitList" + newPid).append(obj);
						}
						$("#fruitList" + newPid).listview();
						$("#fruitList" + newPid).listview('refresh');
						if(pageId == '511'){
							$.mobile.changePage("#page_5_1_2",{transition:"slide"});
						}else if(pageId == '521'){
							$.mobile.changePage("#page_5_2_2",{transition:"slide"});
						}
					}
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});	
	}
	function getNew(pageId){
		var newPid = '';
		if(pageId == '521'){
			newPid = '522';
		}
		$("#fruitList" + newPid + " li").remove();
		JKjsonP({
			ws:"merchants/listFruitByIsNew",
			parameter:{shopId:window.shopId},
			sFunc:function(json){
				if(json.result=="success"){
					var fruitArr = json.data;
					var len = fruitArr.length;
					if(len==0){
						alert("没有搜索到水果");
					}else{
						for(var i = 0;i<len;i++){
							var fruitId511 = fruitArr[i].id;
							var name511 =  fruitArr[i].name;
							var grade511 = fruitArr[i].grade;
							if(grade511==null){
								grade511=2.5;
							}
							var avgPrice511 = fruitArr[i].avgPrice;
							var util511 = fruitArr[i].util;
							var price511 = fruitArr[i].price;
							var weight511 = fruitArr[i].weight;
							if(weight511=="1"){
								weight511="/";
							}
							var weekSales511 = fruitArr[i].weekSales;
							
							var monthSales511 = fruitArr[i].monthSales;
							var obj = '<li><a id="'+fruitId511+'"  onClick="searchFruit' + (pageId + 1) + '(this.id)"><div class="ui-grid-b"><div class="ui-block-a" style="margin-top:10px"><p style="font-size:20px">'+name511+'</p></div><div class="ui-block-b" style="font-size:20px;width:auto"><p >挑 '+grade511+'</p><p >'+price511+'元'+weight511+'斤 '+avgPrice511+'元/'+util511+'</p><p >周销量'+weekSales511+'斤 月销量'+monthSales511+'斤</p> </div></div> </a></li>';
							$("#fruitList" + newPid).append(obj);
						}
						$("#fruitList" + newPid).listview();
						$("#fruitList" + newPid).listview('refresh');
						if(pageId == '511'){
							$.mobile.changePage("#page_5_1_2",{transition:"slide"});
						}else if(pageId == '521'){
							$.mobile.changePage("#page_5_2_2",{transition:"slide"});
						}
					}
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});	
	}
</script>
<div data-role="page" id="page_5_1_1" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">快速修改水果价格</h1>
  </div>
  <div data-role="content" align="center">
    <div class="ui-grid-a">
      <div class="ui-block-a" style="width:70%;margin-top:5px">
        <input type="search" placeholder="具体水果 水果大类"  id="sFruitName511" style="color:#000000;">
      </div>
      <div class="ui-block-b" style="width:30%" align="right"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="search51x(511)" style="background-color:#55c3f1; color:#247f9f;">搜索</a> </div>
    </div>
    <ul data-role="listview"   id="classList511"  style="margin-top:15px;" >
    <li data-icon="false" ><a onClick="getImport(511)">进口水果</a></li>
       <li data-icon="false" ><a onClick="getNew(511)">新品上市</a></li>
      <li data-role="list-divider" id="classlist511SG" style="display:none;">水果拼盘</li>
      <li data-role="list-divider" id="classlist511A" style="display:none;">A</li>
      <li data-role="list-divider" id="classlist511B" style="display:none;">B</li>
      <li data-role="list-divider" id="classlist511C" style="display:none">C</li>
      <li data-role="list-divider" id="classlist511D" style="display:none">D</li>
      <li data-role="list-divider" id="classlist511E" style="display:none">E</li>
      <li data-role="list-divider" id="classlist511F" style="display:none">F</li>
      <li data-role="list-divider" id="classlist511G" style="display:none">G</li>
      <li data-role="list-divider" id="classlist511H" style="display:none">H</li>
      <li data-role="list-divider" id="classlist511I" style="display:none">I</li>
      <li data-role="list-divider" id="classlist511J" style="display:none">J</li>
      <li data-role="list-divider" id="classlist511K" style="display:none">K</li>
      <li data-role="list-divider" id="classlist511L" style="display:none">L</li>
      <li data-role="list-divider" id="classlist511M" style="display:none">M</li>
      <li data-role="list-divider" id="classlist511N" style="display:none">N</li>
      <li data-role="list-divider" id="classlist511O" style="display:none">O</li>
      <li data-role="list-divider" id="classlist511P" style="display:none">P</li>
      <li data-role="list-divider" id="classlist511Q" style="display:none">Q</li>
      <li data-role="list-divider" id="classlist511R" style="display:none">R</li>
      <li data-role="list-divider" id="classlist511S" style="display:none">S</li>
      <li data-role="list-divider" id="classlist511T" style="display:none">T</li>
      <li data-role="list-divider" id="classlist511U" style="display:none">U</li>
      <li data-role="list-divider" id="classlist511V" style="display:none">V</li>
      <li data-role="list-divider" id="classlist511W" style="display:none">W</li>
      <li data-role="list-divider" id="classlist511X" style="display:none">X</li>
      <li data-role="list-divider" id="classlist511Y" style="display:none">Y</li>
      <li data-role="list-divider" id="classlist511Z" style="display:none">Z</li>
     <li data-role="list-divider" id="classlist511QT" style="display:none">其它</li>
    </ul>
  </div>
</div>
<script type="text/javascript">
function search51x(id){
	   
	   if($("#sFruitName"+id).val()==""){
		   alert("请输入具体水果名称或水果大类");
		   return;
	   }
	   $("#fruitList li").remove();
					JKjsonP({
			ws:"merchants/searchFruit",
			parameter:{name:$("#sFruitName"+id).val(),shopId:window.shopId},
			sFunc:function(json){
				if(json.result=="success"){
					var fruitArr = json.data;
					var len = fruitArr.length;
					if(len==0){
					alert("没有搜索到水果");
					}else{
					for(var i = 0;i<len;i++){
						var fruitId511 = fruitArr[i].id;
						var name511 =  fruitArr[i].name;
						var grade511 = fruitArr[i].grade;
						if(grade511==null){
						grade511=2.5;
						}
						var avgPrice511 = fruitArr[i].avgPrice;
						var util511 = fruitArr[i].util;
						var price511 = fruitArr[i].price;
						var weight511 = fruitArr[i].weight;
						if(weight511=="1"){
						weight511="/";
						}
						var weekSales511 = fruitArr[i].weekSales;
						var monthSales511 = fruitArr[i].monthSales;
						var obj = '<li><a id="'+fruitId511+'"  onClick="searchFruit512(this.id)"><div class="ui-grid-a"><div class="ui-block-a" style="margin-top:10px"><p style="font-size:16px">'+name511+'</p></div><div class="ui-block-a" style="font-size:20px;width:auto"><p >挑 '+grade511+'</p><p >'+price511+'元'+weight511+'斤 '+avgPrice511+'元/'+util511+'</p><p >周销量'+weekSales511+'斤 月销量'+monthSales511+'斤</p> </div></div> </a></li>'
						$("#fruitList").append(obj);
						}
						$("#fruitList").listview();
					$("#fruitList").listview('refresh');
					$.mobile.changePage("#page_5_1_2",{transition:"slide"});
					}
					}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
						
						
   }
  
   function searchID511(id){
	  $("#fruitList li").remove();
					var len=farr.length;
					
						for (var i=0;i<len;i++){
							var obj=window.farr[i];
						var classID = obj.classID;
						if(classID==id){
							var fruitId511 = obj.FruitID;
						var name511 =  obj.FruitName;
						var grade511 = obj.grade;
						if(grade511==null){
						grade511=2.5;
						}
						var avgPrice511 = obj.avgPrice;
						var util511 = obj.util;
						var price511 = obj.price;
						var weight511 = obj.weight;
						if(weight511=="1"){
						weight511="/";
						}
						var weekSales511 = obj.weekSales;
						
						var monthSales511 = obj.monthSales;
							var fruit = '<li><a id="'+fruitId511+'"  onClick="searchFruit512(this.id)"><div class="ui-grid-a"><div class="ui-block-a" style="margin-top:10px"><p style="font-size:16px">'+name511+'</p></div><div class="ui-block-a" style="font-size:20px;width:auto"><p >挑 '+grade511+'</p><p >'+price511+'元'+weight511+'斤 '+avgPrice511+'元/'+util511+'</p><p >周销量'+weekSales511+'斤 月销量'+monthSales511+'斤</p> </div></div> </a></li>';
						$("#fruitList").append(fruit);
							
						}
						}
		$("#fruitList").listview();
					$("#fruitList").listview('refresh');
		$.mobile.changePage("#page_5_1_2",{transition:"slide"});

   }
   </script>
<div data-role="page" id="page_5_1_2" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" href="#page_5_1_1" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">快速修改水果价格</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a">
      <div class="ui-block-a" style="width:70%;margin-top:5px">
        <input type="search" placeholder="具体水果 水果大类"  id="sFruitName512">
      </div>
      <div class="ui-block-b" style="width:30%" align="right"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="search51x(512)" style="background-color:#7acdf4;">搜索</a> </div>
    </div>
    <ul data-role="listview"   id="fruitList"  style="margin-top:15px">
      <li ><a href="#page_5_1_4">
        <div class="ui-grid-b">
          <div class="ui-block-a" style="margin-top:10px">
            <p style="font-size:25px">红富士</p>
          </div>
          <div class="ui-block-b" style="font-size:20px;width:auto">
            <p >挑 4.5</p>
            <p >5元/斤 2元/个</p>
            <p >周销量50斤 月销量200斤</p>
          </div>
        </div>
        </a></li>
      <li><a href="#page_5_1_4">
        <div class="ui-grid-b">
          <div class="ui-block-a" style="margin-top:10px">
            <p style="font-size:25px">红富士</p>
          </div>
          <div class="ui-block-b" style="font-size:20px;width:auto">
            <p >挑 4.5</p>
            <p >5元/斤 2元/个</p>
            <p >周销量50斤 月销量200斤</p>
          </div>
        </div>
        </a></li>
      <li><a onClick="go514()">
        <div class="ui-grid-b">
          <div class="ui-block-a" style="margin-top:10px">
            <p style="font-size:25px">红富士</p>
          </div>
          <div class="ui-block-b" style="font-size:20px;width:auto">
            <p >挑 4.5</p>
            <p >5元/斤 2元/个</p>
            <p >周销量50斤 月销量200斤</p>
          </div>
        </div>
        </a></li>
    </ul>
  </div>
</div>
<script type="text/javascript">
function searchFruit512(id){
	var len=farr.length;
					
						for (var i=0;i<len;i++){
							var obj=window.farr[i];
						var FruitID = obj.FruitID;
						if(FruitID==id){
							var FruitName = obj.FruitName;
							var avgPrice = obj.avgPrice;
							var util = obj.util;
							var price = obj.price;
							var weight = obj.weight;
							if(weight=="1"){
							weight="/";
							}
							$("#fruitId514").val(id);
							$("#fruit514").html(FruitName);
							$("#avgPrice514").html(avgPrice);
							$("#util514").html(util);
							$("#price514").html(price);
							$("#weight514").html(weight);
						}
						}
						
				$.mobile.changePage("#page_5_1_4",{transition:"slide"});		
	
}
</script>
<div data-role="page" id="page_5_1_4" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">快速修改水果价格</h1>
  </div>
  <div data-role="content">
    <h3 id="fruit514"></h3>
    <input type="hidden" id="fruitId514"/>
    <div class="ui-grid-c" style="width:300px;" >
      <div class="ui-block-a" style="margin-top:15px;width:auto" >
        <label for="fruitpice51ge" >新单位价格</label>
      </div>
      <div class="ui-block-b" style="width:50px;margin-left:10px">
        <input type="text" id="fruitpice514ge">
      </div>
      <div class="ui-block-c" style="margin-top:15px;margin-left:10px" > <span>元/</span></div>
      <div class="ui-block-d" style="margin-top:-5px;margin-left:-40px" > <span>
        <select name="day" id="day514" class="ui-btn-icon-left ui-icon-arrow-d">
          <option value="个">个</option>
           <option value="十个">十个</option>
          <option value="串">串</option>
          <option value="根">根</option>
          <option value="盒">盒</option>
        </select>
        </span> </div>
    </div>
    <div class="ui-grid-b" style="width:300px;" >
      <div class="ui-block-a" style="margin-top:15px">
        <label for="fruitpice514jin">新价格</label>
      </div>
      <div class="ui-block-b" style="width:50px;margin-left:-10px" >
        <input type="text" id="fruitpice514jin" onBlur="priceBlur514(this)">
      </div>
      <div class="ui-block-c" style="margin-top:15px;margin-left:10px" align="left"> <span>元/斤</span> </div>
    </div>
    <div class="ui-grid-d"  >
      <div class="ui-block-a" style="margin-top:15px">
        <label for="fruitpice514jin">或填写</label>
      </div>
      <div class="ui-block-b" style="width:50px" >
        <input type="text" id="fruitpice514yuan" onBlur="priceBlur514(this)">
      </div>
      <div class="ui-block-c" style="margin-top:15px;margin-left:10px" > <span >元</span> </div>
      <div class="ui-block-d" style="width:50px;margin-left:-40px" >
        <input type="text" id="fruitpice514njin" onBlur="priceBlur514(this)">
      </div>
      <div class="ui-block-e" style="margin-top:15px;margin-left:10px" > <span>斤</span> </div>
    </div>
    <br>
    <div class="ui-grid-b">
      <div class="ui-block-a"><span>原单位价格</span></div>
      <div class="ui-block-b" align="right" style="margin-left:-50px"><span id="avgPrice514">8</span></div>
      <div class="ui-block-c"><span >元/<span id="util514"></span></span></div>
    </div>
    <br>
    <div class="ui-grid-b">
      <div class="ui-block-a"><span>原价格</span></div>
      <div class="ui-block-b" align="right" style="margin-left:-50px"><span id="price514">20</span></div>
      <div class="ui-block-c"><span>元</span><span id="weight514"></span><span>斤</span></div>
    </div>
    <p align="center"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="modifyPrice()" style="background-color:#7acdf4;">确定修改</a> </p>
  </div>
</div>
<script type="text/javascript">
function priceBlur514(obj){
	if($(obj).attr("id") == 'fruitpice514jin'){
		if($.trim($(obj).val()) != ''){
			$("#fruitpice514yuan").val("").attr("disabled", true);
			$("#fruitpice514njin").val("").attr("disabled", true);
		}else{
			$("#fruitpice514yuan").attr("disabled", false);
			$("#fruitpice514njin").attr("disabled", false);
		}
	}
	
	if($(obj).attr("id") == 'fruitpice514yuan' || $(obj).attr("id") == 'fruitpice514njin'){
		if($.trim($("#fruitpice514yuan").val()) != '' || $.trim($("#fruitpice514njin").val()) != ''){
			$("#fruitpice514jin").val("").attr("disabled", true);
		}else{
			$("#fruitpice514jin").attr("disabled", false);
		}
	}
}
function modifyPrice(){
	var id = $("#fruitId514").val();
	
	if($("#fruitpice514ge").val()!=""){
		avgPrice = $("#fruitpice514ge").val();
	}else{
		alert("请填写平均单位价格");
		return;
	}
	if($("#day").val()!=""){
		util = $("#day").val();
	}else{
		util = "个";
	}
	if($("#fruitpice514jin").val()!=""){
		price = $("#fruitpice43jin").val();
		weight = '1';
	}else if($("#fruitpice514yuan").val()!="" && $("#fruitpice514njin").val()!=""){
		price = $("#fruitpice514yuan").val();
		weight = $("#fruitpice514njin").val();
	}else{
		alert("请认真填写销售价格");
		return;
	}
	JKjsonP({
			ws:"merchants/modifyPrice",
			parameter:{id:id, price:price,util:util,avgPrice:avgPrice,weight:weight},
			sFunc:function(json){
				if(json.result=="success"){
					alert(json.msg);
					listFruitList("511");
					$.mobile.changePage("#page_5_1_1",{transition:"slide"});
				}else{
				alert(json.msg);
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
}
</script>
<div data-role="page" id="page_5_2_1" data-theme="jk">
  <div data-role="header">
    <h1 class="ui-corner-all">水果管理</h1>
    <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a> </div>
  <div data-role="content" align="center">
    <div class="ui-grid-a">
      <div class="ui-block-a" style="width:70%;margin-top:5px">
        <input type="search" placeholder="具体水果 水果大类"  id="sFruitName521"  style="color:#000000;">
      </div>
      <div class="ui-block-b" style="width:30%" align="right"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="search52x(521)" style="background-color:#55c3f1; color:#247f9f;">搜索</a> </div>
    </div>
    <ul data-role="listview"   id="classList521"  style="margin-top:15px">
    <li data-icon="false" ><a onClick="getImport(521)">进口水果</a></li>
       <li data-icon="false" ><a onClick="getNew(521)">新品上市</a></li>
      <li data-role="list-divider" id="classlist521SG" style="display:none">水果拼盘</li>
      <li data-role="list-divider" id="classlist521A" style="display:none">A</li>
      <li data-role="list-divider" id="classlist521B" style="display:none">B</li>
      <li data-role="list-divider" id="classlist521C" style="display:none">C</li>
      <li data-role="list-divider" id="classlist521D" style="display:none">D</li>
      <li data-role="list-divider" id="classlist521E" style="display:none">E</li>
      <li data-role="list-divider" id="classlist521F" style="display:none">F</li>
      <li data-role="list-divider" id="classlist521G" style="display:none">G</li>
      <li data-role="list-divider" id="classlist521H" style="display:none">H</li>
      <li data-role="list-divider" id="classlist521I" style="display:none">I</li>
      <li data-role="list-divider" id="classlist521J" style="display:none">J</li>
      <li data-role="list-divider" id="classlist521K" style="display:none">K</li>
      <li data-role="list-divider" id="classlist521L" style="display:none">L</li>
      <li data-role="list-divider" id="classlist521M" style="display:none">M</li>
      <li data-role="list-divider" id="classlist521N" style="display:none">N</li>
      <li data-role="list-divider" id="classlist521O" style="display:none">O</li>
      <li data-role="list-divider" id="classlist521P" style="display:none">P</li>
      <li data-role="list-divider" id="classlist521Q" style="display:none">Q</li>
      <li data-role="list-divider" id="classlist521R" style="display:none">R</li>
      <li data-role="list-divider" id="classlist521S" style="display:none">S</li>
      <li data-role="list-divider" id="classlist521T" style="display:none">T</li>
      <li data-role="list-divider" id="classlist521U" style="display:none">U</li>
      <li data-role="list-divider" id="classlist521V" style="display:none">V</li>
      <li data-role="list-divider" id="classlist521W" style="display:none">W</li>
      <li data-role="list-divider" id="classlist521X" style="display:none">X</li>
      <li data-role="list-divider" id="classlist521Y" style="display:none">Y</li>
      <li data-role="list-divider" id="classlist521Z" style="display:none">Z</li>
      <li data-role="list-divider" id="classlist521QT" style="display:none">其它</li>
    </ul>
  </div>
</div>
<script type="text/javascript">

   function search52x(id){
	   
	   if($("#sFruitName"+id).val()==""){
		   alert("请输入具体水果名称或水果大类");
		   return;
	   }
	   $("#fruitList522 li").remove();
					JKjsonP({
			ws:"merchants/searchFruit",
			parameter:{name:$("#sFruitName"+id).val(),shopId:window.shopId},
			sFunc:function(json){
				if(json.result=="success"){
					var fruitArr = json.data;
					var len = fruitArr.length;
					if(len==0){
					alert("没有搜索到水果");
					}else{
					for(var i = 0;i<len;i++){
						var fruitId511 = fruitArr[i].id;
						var name511 =  fruitArr[i].name;
						var grade511 = fruitArr[i].grade;
						if(grade511==null){
						grade511=2.5;
						}
						var avgPrice511 = fruitArr[i].avgPrice;
						var util511 = fruitArr[i].util;
						var price511 = fruitArr[i].price;
						var weight511 = fruitArr[i].weight;
						if(weight511=="1"){
						weight511="/";
						}
						var weekSales511 = fruitArr[i].weekSales;
						
						var monthSales511 = fruitArr[i].monthSales;
						var obj = '<li><a id="'+fruitId511+'"  onClick="searchFruit522(this.id)"><div class="ui-grid-a"><div class="ui-block-a" style="margin-top:10px"><p style="font-size:16px">'+name511+'</p></div><div class="ui-block-a" style="font-size:20px;width:auto"><p >挑 '+grade511+'</p><p >'+price511+'元'+weight511+'斤 '+avgPrice511+'元/'+util511+'</p><p >周销量'+weekSales511+'斤 月销量'+monthSales511+'斤</p> </div></div> </a></li>'
						$("#fruitList522").append(obj);
						}
						$("#fruitList522").listview();
					$("#fruitList522").listview('refresh');
					$.mobile.changePage("#page_5_2_2",{transition:"slide"});
					}
					}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
						
						
						
	 
   }
   function searchID521(id){
	  $("#fruitList522 li").remove()
					var len=farr.length;
					
						for (var i=0;i<len;i++){
							var obj=window.farr[i];
						var classID = obj.classID;
						if(classID==id){
							var FruitName = obj.FruitName;
							var FruitID =obj.FruitID;
							$("#fruitList522").append('<li><a id="'+FruitID+'"  onClick="searchFruit522(this.id)" class="ui-btn ui-btn-icon-right ui-icon-carat-r" style="color:#247f9f;">'+FruitName+'</a></li>');
						}
						}
		
		$.mobile.changePage("#page_5_2_2",{transition:"slide"});
		
		
		$("#fruitList522 li").remove();
					var len=farr.length;
					
						for (var i=0;i<len;i++){
							var obj=window.farr[i];
						var classID = obj.classID;
						if(classID==id){
							var fruitId511 = obj.FruitID;
						var name511 =  obj.FruitName;
						var grade511 = obj.grade;
						if(grade511==null){
						grade511=2.5;
						}
						var avgPrice511 = obj.avgPrice;
						var util511 = obj.util;
						var price511 = obj.price;
						var weight511 = obj.weight;
						if(weight511=="1"){
						weight511="/";
						}
						var weekSales511 = obj.weekSales;
						
						var monthSales511 = obj.monthSales;
							var fruit = '<li><a id="'+fruitId511+'"  onClick="searchFruit522(this.id)"><div class="ui-grid-a"><div class="ui-block-a" style="margin-top:10px"><p style="font-size:16px">'+name511+'</p></div><div class="ui-block-a" style="font-size:20px;width:auto"><p >挑 '+grade511+'</p><p >'+price511+'元'+weight511+'斤 '+avgPrice511+'元/'+util511+'</p><p >周销量'+weekSales511+'斤 月销量'+monthSales511+'斤</p> </div></div> </a></li>';
						$("#fruitList522").append(fruit);
							
						}
						}
		$("#fruitList522").listview();
					$("#fruitList522").listview('refresh');
		$.mobile.changePage("#page_5_2_2",{transition:"slide"});

   }
   </script>
<div data-role="page" id="page_5_2_2" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" href="#page_5_2_1" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">水果管理</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a">
      <div class="ui-block-a" style="width:70%;margin-top:5px">
        <input type="search" placeholder="具体水果 水果大类"  id="sFruitName522">
      </div>
      <div class="ui-block-b" style="width:30%" align="right"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="search52x(522)" style="background-color:#55c3f1; color:#247f9f;">搜索</a> </div>
    </div>
    <ul data-role="listview"   id="fruitList522"  style="margin-top:15px">
      <li><a>
        <div class="ui-grid-b">
          <div class="ui-block-a" style="margin-top:10px">
            <p style="font-size:25px">红富士</p>
          </div>
          <div class="ui-block-b" style="font-size:20px;width:auto">
            <p >挑 4.5</p>
            <p >5元/斤 2元/个</p>
            <p >周销量50斤 月销量200斤</p>
          </div>
        </div>
        </a></li>
    </ul>
  </div>
</div>
<script type="text/javascript">
function searchFruit522(id){
	$("#fruitId525").val(id);
	$("#fruitpice52yuan").val("");
							$("#fruitpice52njin").val("");
							$("#fruitpice52jin").val("");
	var len=farr.length;
					
						for (var i=0;i<len;i++){
							var obj=window.farr[i];
						var FruitID = obj.FruitID;
						if(FruitID==id){
							var FruitName = obj.FruitName;
							$("#fruit524").html(FruitName);
							$("#fruit525").val(FruitName);
							var classID = obj.classID;
							window.classID = classID;
							for(var j=0;j<arrAll.length;j++){
							if(classID==arrAll[j][1]){
								$("#className525").html(arrAll[j][2]);	
								$("#className524").html(arrAll[j][2]);	
								}
							}
							var isImport = obj.isImport;
							$("#isimport525").val(isImport);
							if(isImport==true){
								$("#true525").attr("selected",true);
								$("#false525").attr("selected",false);
								isImport="是";
								
							}else if(isImport==false){
								$("#true525").attr("selected",false);
								$("#false525").attr("selected",true);
							isImport="否";
							
							}
							$('#isimport525').selectmenu();
							$('#isimport525').selectmenu('refresh', true);
							$("#isimport524").html(isImport);
							var description = obj.Description;
							$("#description524").html(description);
							$("#fruitInfo525").val(description);
							var avgPrice = obj.avgPrice;
							$("#fruitpice52ge").val(avgPrice);
							var util = obj.util;
							$("#day52").val(util);
							$('#day52').selectmenu();
							$('#day52').selectmenu('refresh', true);
							var avgPriceStr = avgPrice+"元/"+util;
							$("#avgPrice524").html(avgPriceStr);
							var price = obj.price;
							var weight = obj.weight;
							if(weight=="1"){
							weight="/";
							$("#fruitpice52jin").val(price);
							}else{
							$("#fruitpice52yuan").val(price);
							$("#fruitpice52njin").val(weight);
							}
							
							var priceStr = price+"元"+weight+"斤";
							$("#price524").html(priceStr);
							var grade = obj.grade;
							if(grade==null){
							grade="2.5";
							}
							$("#grade524").html(grade);
							var weekSales=obj.weekSales
							$("#weekSales524").html(weekSales+"斤");
                           var monthSales = obj.monthSales;
						   $("#monthSales524").html(monthSales+"斤");
						   var dateCreated = obj.dateCreated;
						   $("#dateCreated524").html(dateCreated);
						   $("#delFruit524").attr("onClick","delFruit("+id+")");
						   var state = obj.status;
						   if(state =="2"){
							    $("#state524").html("重新上架");
						   	$("#state524").attr("onClick","modifyFruitStatus(1,"+id+")");
						   }else{
							  $("#state524").html("下架");
							  $("#state524").attr("onClick","modifyFruitStatus(2,"+id+")");
						   }
						   
						}
						}
				$('#fruitID').val(id);
				$.mobile.changePage("#page_5_2_4",{transition:"slide"});
	
}
function updPic(){
	retWhere = "#page_5_2_4";
	$.mobile.changePage("#page_4_6",{transition:"slide"});
}
</script>
<div data-role="page" id="page_5_2_4" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" href="#page_5_2_2">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">水果管理</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a">
      <div class="ui-block-a" style="width:60%">
        <h3 id="fruit524"></h3>
      </div>
      <div class="ui-block-b" align="right" style="width:40%"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" href="#page_5_2_5" data-transition="slide" style="background-color:#55c3f1; color:#247f9f;">修改全部</a> </div>
    </div>
    <div class="ui-grid-a" >
      <div class="ui-block-a" >
        <p>所属大类</p>
      </div>
      <div class="ui-block-b" >
        <p id="className524" style="margin-left:-40px">苹果</p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>进口水果</p>
      </div>
      <div class="ui-block-b" >
        <p id="isimport524" style="margin-left:-40px" ></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-20px">
      <div class="ui-block-a" >
        <p>图片</p>
      </div>
      <div class="ui-block-b" style="margin-left:-70px"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onclick="updPic();" style="background-color:#55c3f1; color:#247f9f;">修改图片</a> </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-20px">
      <div class="ui-block-a" >
        <p>水果描述</p>
      </div>
      <div class="ui-block-b" >
        <p id="description524" style="margin-left:-40px"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>单位价格</p>
      </div>
      <div class="ui-block-b" >
        <p id="avgPrice524" style="margin-left:-40px"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>价格</p>
      </div>
      <div class="ui-block-b" >
        <p id="price524" style="margin-left:-40px"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>挑评分</p>
      </div>
      <div class="ui-block-b" >
        <p id="grade524" style="margin-left:-40px"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>周销量</p>
      </div>
      <div class="ui-block-b" >
        <p id="weekSales524" style="margin-left:-40px"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>月销量</p>
      </div>
      <div class="ui-block-b" >
        <p id="monthSales524" style="margin-left:-40px"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>上架时间</p>
      </div>
      <div class="ui-block-b" >
        <p id="dateCreated524" style="margin-left:-40px"></p>
      </div>
    </div>
    <div class="ui-grid-a" >
      <div class="ui-block-a" > <a id="state524" class="ui-btn ui-corner-all" href="" style="background-color:#55c3f1; color:#247f9f;">状态</a> </div>
      <div class="ui-block-b" > <a  href="#page_5_2_4_1" data-rel="popup" data-position-to="window" data-transition="pop" class="ui-btn ui-corner-all" style="background-color:#55c3f1; color:#247f9f;">删除</a> 
    </div>
  </div>
  </div>
  <div  data-role="popup" id="page_5_2_4_1" style="width:200px; height:150px;" data-theme="jk">
<br>
    <p align="center">确定删除？</p>
    
    <div class="ui-grid-a" style="padding:21px">
      <div class="ui-block-a"> <a class="ui-btn ui-corner-all ui-btn-inline" data-rel="back" data-icon="back" >返回</a> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all ui-btn-inline" id="delFruit524" >删除</a> </div>
    </div>
  </div>
</div>

<script type="text/javascript">
function modifyFruitStatus(state,id){
		JKjsonP({
			ws:"merchants/modifyFruitStatus",
			parameter:{id:id, status:state},
			sFunc:function(json){
				if(json.result=="success"){
					alert(json.msg);
					if(state=="1"){
					  $("#state524").html("下架");
						   	$("#state524").attr("onClick","modifyFruitStatus(2,"+id+")");
					}else{
					$("#state524").html("重新上架");
						   	$("#state524").attr("onClick","modifyFruitStatus(1,"+id+")");
					}
				}else{
				alert(json.msg);
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
}
function delFruit(id){
		JKjsonP({
			ws:"merchants/delFruit",
			parameter:{id:id},
			sFunc:function(json){
				if(json.result=="success"){
					alert(json.msg);
					listFruitList("521");
					$.mobile.changePage("#page_5_2_1",{transition:"slide"});
				}else{
				alert(json.msg);
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert("该水果已经产生交易记录，无法删除");
			}
		});		
}

</script>
<div data-role="page" id="page_5_2_5" data-theme="jk">
  <div data-role="header"> <a class="ui-btn ui-corner-all" href="#page_5_2_4">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">水果管理</h1>
  </div>
  <div data-role="content">
  <input type="hidden" id="fruitId525"/>
    <label for="fruit525">水果名称</label>
    <input type="text" id="fruit525">
    <div class="ui-grid-b">
      <div class="ui-block-a" style="width:100px">
        <p>所属大类</p>
      </div>
      <div class="ui-block-b" style="width:70px">
        <p id="className525">苹果</p>
      </div>
      <div class="ui-block-c"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini"  href="#classlist52" style="background-color:#55c3f1; color:#247f9f;">选择</a> </div>
    </div>
    <div class="ui-grid-a">
      <div class="ui-block-a" style="margin-top:10px;width:100px">
        <label for="isimport525">进口水果</label>
      </div>
      <div class="ui-block-b" >
        <select nname="isimport525" id="isimport525">
            <option id="false525" value="false">否</option>
            <option id="true525" value="true">是</option>
          </select>
      </div>
    </div>
    <div class="ui-grid-c" style="width:300px;" >
      <div class="ui-block-a" style="margin-top:15px;width:auto" >
        <label for="fruitpice52ge" >新单位价格</label>
      </div>
      <div class="ui-block-b" style="width:50px;margin-left:10px">
        <input type="text" id="fruitpice52ge">
      </div>
      <div class="ui-block-c" style="margin-top:15px;margin-left:10px" > <span>元/</span></div>
      <div class="ui-block-d" style="margin-top:-5px;margin-left:-40px;width:100px" > <span>
        <select name="day" id="day52" class=" ui-icon-arrow-d ui-btn-icon-left" >
          <option value="个" >个</option>
           <option value="十个">十个</option>
          <option value="串" >串</option>
          <option value="根" >根</option>
          <option value="盒">盒</option>
        </select>
        </span> </div>
    </div>
    <div class="ui-grid-b" style="width:300px;" >
      <div class="ui-block-a" style="margin-top:15px">
        <label for="fruitpice52jin">新价格</label>
      </div>
      <div class="ui-block-b" style="width:50px;margin-left:-10px" >
        <input type="text" id="fruitpice52jin" onBlur="priceBlur52(this)">
      </div>
      <div class="ui-block-c" style="margin-top:15px;margin-left:10px" align="left"> <span>元/斤</span> </div>
    </div>
    <div class="ui-grid-d"  >
      <div class="ui-block-a" style="margin-top:15px">
        <label for="fruitpice52jin">或填写</label>
      </div>
      <div class="ui-block-b" style="width:50px" >
        <input type="text" id="fruitpice52yuan" onBlur="priceBlur52(this)">
      </div>
      <div class="ui-block-c" style="margin-top:15px;margin-left:10px" > <span>元</span> </div>
      <div class="ui-block-d" style="width:50px;margin-left:-40px" >
        <input type="text" id="fruitpice52njin" onBlur="priceBlur52(this)"> 
      </div>
      <div class="ui-block-e" style="margin-top:15px;margin-left:10px" > <span>斤</span> </div>
    </div>
    <div class="ui-field-contain">
      <label for="fruitInfo525">水果描述：</label>
      <textarea name="fruitInfo525" id="fruitInfo525"  ></textarea>
    </div>
    <p align="center"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" onClick="modifyFruit()" style="background-color:#55c3f1; color:#247f9f;">确定</a> </p>
  </div>
</div>
<script type="text/javascript">
function priceBlur52(obj){
	if($(obj).attr("id") == 'fruitpice52jin'){
		if($.trim($(obj).val()) != ''){
			$("#fruitpice52yuan").val("").attr("disabled", true);
			$("#fruitpice52njin").val("").attr("disabled", true);
		}else{
			$("#fruitpice52yuan").attr("disabled", false);
			$("#fruitpice52njin").attr("disabled", false);
		}
	}
	
	if($(obj).attr("id") == 'fruitpice52yuan' || $(obj).attr("id") == 'fruitpice52njin'){
		if($.trim($("#fruitpice52yuan").val()) != '' || $.trim($("#fruitpice52njin").val()) != ''){
			$("#fruitpice52jin").val("").attr("disabled", true);
		}else{
			$("#fruitpice52jin").attr("disabled", false);
		}
	}
}
function modifyFruit(){
	var id = $("#fruitId525").val();
	var fruitName = $("#fruit525").val();
	var isImport=$("#isimport525").val();
	var description = $("#fruitInfo525").val();
	var avgPrice = $("#fruitpice52ge").val();
	var util = $("#day52").val();
	var price = "";
	var weight = "";
	if($("#fruitpice52jin").val()!=""){
		price = $("#fruitpice52jin").val();
		weight = '1';
	}else if($("#fruitpice52yuan").val()!="" && $("#fruitpice52njin").val()!=""){
		price = $("#fruitpice52yuan").val();
		weight = $("#fruitpice52njin").val();
	}else{
		alert("请认真填写销售价格");
		return;
	}
JKjsonP({
			ws:"merchants/modifyPrice",
			parameter:{id:id,"name": fruitName, "categoryId": window.classID,"isImport": isImport, "description": description, "avgPrice": avgPrice, "util": util, "price": price, "weight": weight, "shopId": window.shopId,"monthSales":0,"weekSales":0},
			sFunc:function(json){
			
				if(json.result=="success"){
					alert(json.msg);
					listFruitList("521");
					$.mobile.changePage("#page_5_2_1",{transition:"slide"});
				}else{
				alert(json.msg);
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
}
</script>
<div data-role="page" id="classlist52" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">水果列表</h1>
  </div>
  <div data-role="content">
    <ul data-role="listview"   id="classList52" >
    <li data-role="list-divider" id="classlist52SG" style="display:none">水果拼盘</li>
      <li data-role="list-divider" id="classlist52A" style="display:none">A</li>
      <li data-role="list-divider" id="classlist52B" style="display:none">B</li>
      <li data-role="list-divider" id="classlist52C" style="display:none">C</li>
      <li data-role="list-divider" id="classlist52D" style="display:none">D</li>
      <li data-role="list-divider" id="classlist52E" style="display:none">E</li>
      <li data-role="list-divider" id="classlist52F" style="display:none">F</li>
      <li data-role="list-divider" id="classlist52G" style="display:none">G</li>
      <li data-role="list-divider" id="classlist52H" style="display:none">H</li>
      <li data-role="list-divider" id="classlist52I" style="display:none">I</li>
      <li data-role="list-divider" id="classlist52J" style="display:none">J</li>
      <li data-role="list-divider" id="classlist52K" style="display:none">K</li>
      <li data-role="list-divider" id="classlist52L" style="display:none">L</li>
      <li data-role="list-divider" id="classlist52M" style="display:none">M</li>
      <li data-role="list-divider" id="classlist52N" style="display:none">N</li>
      <li data-role="list-divider" id="classlist52O" style="display:none">O</li>
      <li data-role="list-divider" id="classlist52P" style="display:none">P</li>
      <li data-role="list-divider" id="classlist52Q" style="display:none">Q</li>
      <li data-role="list-divider" id="classlist52R" style="display:none">R</li>
      <li data-role="list-divider" id="classlist52S" style="display:none">S</li>
      <li data-role="list-divider" id="classlist52T" style="display:none">T</li>
      <li data-role="list-divider" id="classlist52U" style="display:none">U</li>
      <li data-role="list-divider" id="classlist52V" style="display:none">V</li>
      <li data-role="list-divider" id="classlist52W" style="display:none">W</li>
      <li data-role="list-divider" id="classlist52X" style="display:none">X</li>
      <li data-role="list-divider" id="classlist52Y" style="display:none">Y</li>
      <li data-role="list-divider" id="classlist52Z" style="display:none">Z</li>
      <li data-role="list-divider" id="classlist52QT" style="display:none">其它</li>
    </ul>
  </div>
</div>
<div data-role="page" id="page_6_1" data-theme="jk">
  <div data-role="header">
    <h1 class="ui-corner-all">系统设置</h1>
    <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a> </div>
  <div data-role="content">
    <ul data-role="listview"   id="systemList" >
      
      <!-- <li onClick="on_page_6_1_1()">最大配送距离</li> <li onClick="on_page_6_1_2()">起送价/配送费</li> 
						<li onClick="on_page_6_1_5()">预计送达时间</li> <li onClick="on_page_6_1_4()">配送员最大携带重量</li> 
						<li onClick="on_page_6_1_6()">营业时间</li> <li onClick="on_page_6_1_7()">店内端和外送端用户名及密码</li> 
						<li onClick="on_page_6_3()">申请商家店内端和外送端</li> <li onClick="on_page_6_2()">商铺信息</li> -->
      <li> <a    onClick="go611()" data-transition="slide" >最大配送距离</a> </li>
      <li> <a  onClick="go612()" data-transition="slide">起送价/配送费</a> </li>
      <!--<li> <a href="#page_6_1_5" href="#page_6_1_5" data-transition="slide">预计送达时间</a> </li>-->
      <li> <a  onClick="go614()"  data-transition="slide">送货员交通工具和最大携带重量</a> </li>
      <li> <a   onClick="go616()" data-transition="slide">营业时间</a> </li>
      <li> <a  onClick="go617()" data-transition="slide">配货端和送货端用户名及密码</a> </li>
      <li> <a  onClick="go63()" data-transition="slide">申请商铺配货端和送货端</a> </li>
      <li> <a onClick="go62()" data-transition="slide">商铺信息</a> </li>
      <li> <a href="#page_6_4"  data-transition="slide">修改登录密码</a> </li>
    </ul>
  </div>
</div>
<script type="text/javascript">
function go62(){
	getLastTime();
		var shopName62 = window.storage.getItem("shopName");
		var telephone62 = window.storage.getItem("LoginName");
		var code62 = window.storage.getItem("code");
		var address62 = window.storage.getItem("address");
		$("#shopName62").html(shopName62);		
		$("#telephone62").html(telephone62);	
		$("#code62").html(code62);	
		$("#address62").html(address62);	
		JKjsonP({
			ws:"merchants/getShopIncome",
			parameter:{shopId:window.shopId},
			sFunc:function(json){
				if(json.result=="success"){
					var today62 = json.data.today;
					var currentMonth62 = json.data.currentMonth;
					var lastMonth62 = json.data.lastMonth;
					var thisWeek62 = json.data.thisWeek;
					$("#today62").html("￥"+today62+"元");
					$("#currentMonth62").html("￥"+currentMonth62+"元");
					$("#lastMonth62").html("￥"+lastMonth62+"元");
					$("#thisWeek62").html("￥"+thisWeek62+"元");
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
		$.mobile.changePage("#page_6_2",{transition: "slide"});		
	}
function go612(){
	$("#page_6_1_2 .ui-grid-a").remove();
	$("#page_6_1_2 .ui-grid-c").remove();
	for(var i=1;i<=window.maxDistance611;i++){
		$("#hr612").append($('<div class="ui-grid-a"><div class="ui-block-a" style="width:30%"><p style="margin-top:30px">'+i+'公里</p></div><div class="ui-block-b" > <p> <select name="switch" id="switch612'+i+'" onChange="change612(this.id)"> <option value="selqisong612" >起送价</option><option value="selsonghuo612">送货费</option></select> </p> </div></div><div class="ui-grid-c"> <div class="ui-block-a" style="width:60px;margin-top:7px"><p id="qi'+i+'">起送价</p> </div><div class="ui-block-b" style="width:50px"> <p > <input type="number" min="0" max="100" value="0" id="qisong'+i+'" style="background-color: #fff"/> </p></div><div class="ui-block-c" style="width:80px;margin-left:20px;;margin-top:7px"><p style="display:none" id="mian'+i+'">免送货费 </p></div><div class="ui-block-d" style="width:50px"><p><input type="hidden" min="0" max="100" value="0" id="miansonghuo'+i+'"/> </p></div></div>'
    ));
		}
		
		function change612(id){
var i =id.substring(id.length,id.length-1);
if($("#switch612"+i).val()=="selsonghuo612"){
	$("#qi"+i).html("送货费");
	$("#qisong"+i).attr("id","songhuo"+i);
	$("#miansonghuo"+i).attr("type","number");
	$("#mian"+i).css("display","block");
}else{
	$("#miansonghuo"+i).attr("type","hidden");
	$("#mian"+i).css("display","none");
}
$("#page_6_1_2 div").trigger("create");
}
		
		JKjsonP({
			ws:"merchants/listShipping",
			parameter:{id:window.shopId},
			sFunc:function(json){
			
				if(json.result=="success"){
					for(var i = 0;i<json.data.length;i++){
						var j = i+1;
						var startPrice = json.data[i].startPrice;
						if(startPrice != 0){
							$("#qisong"+j).val(startPrice);
						}else{
							$("#switch612"+j).val("selsonghuo612");
							$("#qi"+j).html("送货费");
							$("#qisong"+j).attr("id","songhuo"+j);
							$("#miansonghuo"+j).attr("type","number");
							$("#mian"+j).css("display","block");
							$("#page_6_1_2 div").trigger("create");
							$('#switch612'+j).selectmenu();
							$('#switch612'+j).selectmenu('refresh', true);
							var shippingPrice = json.data[i].shippingPrice;
							var freeShippingPrice = json.data[i].freeShippingPrice;
							$("#songhuo"+j).val(shippingPrice);
							$("#miansonghuo"+j).val(freeShippingPrice);
						}
					}
					
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
	$("#page_6_1_2 div").trigger("create");
	$.mobile.changePage("#page_6_1_2",{transition: "slide"});
	}
function go611(){
if(window.maxDistance611!=null){
 $("#maxdistance").val(window.maxDistance611);
}
$.mobile.changePage("#page_6_1_1",{transition: "slide"});
}
function go616(){
if(window.openTime616!=null){
 $("#opentime616").val(window.openTime616);
}
if(window.closeTime616!=null){
 $("#closetime616").val(window.closeTime616);
}
$('#opentime616').selectmenu();
$('#opentime616').selectmenu('refresh', true);
$('#closetime616').selectmenu();
$('#closetime616').selectmenu('refresh', true);
$.mobile.changePage("#page_6_1_6",{transition: "slide"});
}
function go614(){
	$("#sub614ul li").remove();
	JKjsonP({
		ws:"merchants/listSubAdmin",
		parameter:{id:window.shopAdminId},
		sFunc:function(json){
			if(json.result=="success"){
				var obj614 = json.data;
				var len = obj614.length;
				if(len == 0){
					alert("还未申请送货端");
					return;
				}
				for(var i=0;i<len;i++){
					var authority = json.data[i].authority;
					if(authority=="delivery"){
					var subId614 = json.data[i].id;
					var nickName614 = json.data[i].nickName;
					var maxWeight614 = json.data[i].maxWeight;
					if(maxWeight614==null){
					maxWeight614="1"
					}
					var vehicle614 = json.data[i].vehicle;
					if(vehicle614=="0"){
					vehicle614="1"
					}
					window.subId614arr.push(subId614);
					$("#sub614ul").append($('<li><div style="padding:20px"><input type="hidden" value="'+subId614+'" id="subId614'+subId614+'"/><p id="deliveryMan614">'+nickName614+'</p><div class="ui-grid-a" ><div class="ui-block-a" style="margin-top:20px;width:40%"><label for="vehicle614">交通工具</label></div><span class="ui-block-b" style="width:60%"> <select name="vehicle614" id="vehicle614'+subId614+'" val="'+vehicle614+'"><option id="614sel1'+subId614+'" value="1">自行车</option><option id="614sel2'+subId614+'" value="2">电瓶车</option><option id="614sel3'+subId614+'" value="3">汽车</option> </select></span> </div><div class="ui-grid-b"> <div class="ui-block-a" style="width:50%"> <p>最大携带重量</p></div> <div class="ui-block-b" style="width:20%; height:50px; margin-left:-10px; margin-top:-12px; border-bottom:solid 1px; "> <input type="number" id="maWeight614'+subId614+'" min="1" value="'+maxWeight614+'"> </div> <div class="ui-block-c" style="width:20%;margin-left:10px;margin-top:1px "> <p>斤</p></div> </div></div></li>'));
					
					$("#614sel"+vehicle614+subId614).attr("selected",true);
				}
				}
				$("#page_6_1_4 div").trigger("create");
				$.mobile.changePage("#page_6_1_4",{transition: "slide"});
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});
	
}


function go617(){
	$("#sub617ul li").remove();
	$("#sub617ul").append('<li data-role="list-divider" id="sub617" class="ui-li-divider ui-bar-inherit ui-first-child"><div style="white-space:pre-wrap">配货端和送货端用户名及密码在紧急情况可用其他手机登录，如手机没电了</li>');
	JKjsonP({
		ws:"merchants/listSubAdmin",
		parameter:{id:window.shopAdminId},
		sFunc:function(json){
			if(json.result=="success"){
				var obj617 = json.data;
				var len = obj617.length;
				if(len == 0){
					alert("还未申请送货端和配货端");
					return;
				}
				for(var i=0;i<len;i++){
					var nickName617 = json.data[i].nickName;
					var authority617 = json.data[i].authority;
					if(authority617=="delivery"){
						authority617="送货端";
					}else if(authority617=="distribution"){
						authority617="配货端";
					}
					var phone617 = json.data[i].username;
					var password617 = json.data[i].password;
					var subId617 = json.data[i].id;
					
					$('<li ><a onClick="go618(this.id)" id="'+subId617+'" data-transition="slide" class="ui-btn ui-btn-icon-right ui-icon-carat-r" style="border-bottom-width: 1px; margin: 0px; border-top:none"><p><span id="name617'+subId617+'">'+nickName617+'</span><span> 权限:</span><span id="authority617'+subId617+'">'+authority617+'</span></p><p><span >手机号：</span><span id="phone617'+subId617+'">'+phone617+'</span></p><p><span>密码：</span><span id="password617'+subId617+'">'+password617+'</span></p></a></li>').insertAfter($("#sub617"));
					}
				$.mobile.changePage("#page_6_1_7",{transition: "slide"});
				}
			
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});
	
	}
	
function go63(){
$("#in63").attr("checked", "checked");
$("#out63").attr("checked", false);
$("#in63").prev("label").removeClass("ui-radio-off").addClass("ui-radio-on");
$("#out63").prev("label").removeClass("ui-radio-on").addClass("ui-radio-off");
var txt = "";
$("#name63").val(txt);
$("#phone_number63").val(txt);
$("#rephone_number63").val(txt);
$("#password63").val(txt);
$("#repassword63").val(txt);
$.mobile.changePage("#page_6_3",{transition: "slide"});
}
</script>
<div data-role="page" id="page_6_1_1" data-theme="jk">
  <div data-role="header" > <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">系统设置</h1>
  </div>
  <div data-role="content">
   
      <select id="maxdistance">
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5">5</option>
      </select>
    <!--<p style="text-align:center">
      <input type="range" id="maxdistancerg" data-role="none" min="3" max="5"  step="1" value="1" onChange="changeTextRange(this);" style="width:260px"/>
    </p>-->
    <p style="text-align:center"><a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" style="background-color:#52c6f7; color:#FFFFFF" onClick="MaxDistance_submit()">确定</a></p>
  </div>
  <div data-role="popup" class="ui-content"  id="popup15" data-theme="b">
    <p></p>
  </div>
</div>
<script type="text/javascript">
function MaxDistance_submit(){
var maxDistance611 = $("#maxdistance").val();
JKjsonP({
			ws:"merchants/setMaxDistance",
			parameter:{id:window.shopId, maxDistance:maxDistance611},
			sFunc:function(json){
				if(json.result=="success"){
					alert(json.msg);
					window.maxDistance611=maxDistance611;
					localStorage.setItem("maxDistance",maxDistance611);
					$.mobile.changePage("#page_6_1",{transition: "slide"});
				}else{
					alert(json.msg);
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});		
}
</script> 
<!--<div data-role="page" id="page_6_2_2" data-theme="jk">
  <div data-role="header" > <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a>
    <h1>系统设置</h1>
  </div>
  <div data-role="content"> <span>请填写起送价或者填写送货费和免送货费</span><span>(起送价和送货费两组二选一填写)</span>
    <hr>
    <div class="ui-grid-c">
      <div class="ui-block-a"> </div>
      <div class="ui-block-b"> <span>起送价：元</span> </div>
      <div class="ui-block-c"> <span>送货费:元</span> </div>
      <div class="ui-block-d"> <span>免送货费:元</span> </div>
      <div class="ui-block-a"> </div>
      <div class="ui-block-b">
        <input type="checkbox" name="checkbox-1" id="allToOne1" >
        <label for="allToOne1">全部相同</label>
      </div>
      <div class="ui-block-c">
        <input type="checkbox" name="checkbox-2" id="allToOne2">
        <label for="allToOne2">全部相同</label>
      </div>
      <div class="ui-block-d">
        <input type="checkbox" name="checkbox-3" id="allToOne3">
        <label for="allToOne3">全部相同</label>
      </div>
      <div class="ui-block-a"> <span>1公里：</span> </div>
      <div class="ui-block-b" >
        <input type="text" value="" style="" id="oneKilometer1" onBlur="allToOne1()"/>
      </div>
      <div class="ui-block-c">
        <input type="text" value="" id="oneKilometer2"/>
      </div>
      <div class="ui-block-d">
        <input type="text" value="" id="oneKilometer3"/>
      </div>
      <div class="ui-block-a"> <span>2公里：</span> </div>
      <div class="ui-block-b">
        <input type="text" value="" id="twoKilometer1"/>
      </div>
      <div class="ui-block-c">
        <input type="text" value="" id="twoKilometer2"/>
      </div>
      <div class="ui-block-d">
        <input type="text" value="" id="twoKilometer3"/>
      </div>
      <div class="ui-block-a"> <span>3公里：</span> </div>
      <div class="ui-block-b">
        <input type="text" value="" id="threeKilometer1"/>
      </div>
      <div class="ui-block-c">
        <input type="text" value="" id="threeKilometer2"/>
      </div>
      <div class="ui-block-d">
        <input type="text" value="" id="threeKilometer3"/>
      </div>
      <div class="ui-block-a"> <span>4公里：</span> </div>
      <div class="ui-block-b">
        <input type="text" value="" id="fourKilometer1"/>
      </div>
      <div class="ui-block-c">
        <input type="text" value="" id="fourKilometer2"/>
      </div>
      <div class="ui-block-d">
        <input type="text" value="" id="fourKilometer3"/>
      </div>
      <div class="ui-block-a"> <span>5公里：</span> </div>
      <div class="ui-block-b">
        <input type="text" value="" id="fiveKilometer1"/>
      </div>
      <div class="ui-block-c">
        <input type="text" value="" id="fiveKilometer2"/>
      </div>
      <div class="ui-block-d">
        <input type="text" value="" id="fiveKilometer3"/>
      </div>
    </div>
  </div>
</div>-->

<div data-role="page" id="page_6_1_2" data-theme="jk">
  <div data-role="header" > <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1>系统设置</h1>
  </div>
  <div data-role="content" style="border:none"> <span>请填写起送价或者填写送货费和免送货费</span><span>(起送价和送货费两组二选一填写)</span>
    <hr id="hr612" style="border:none">
    <div class="ui-grid-a">
      <div class="ui-block-a" style="width:30%">
        <p style="margin-top:30px;">1公里</p>
      </div>
      <div class="ui-block-b" >
        <p>
          <select name="switch" id="switch6121" onChange="change612(this.id)">
            <option value="selqisong612" >起送价</option>
            <option value="selsonghuo612">送货费</option>
          </select>
        </p>
      </div>
    </div>
    <div class="ui-grid-c">
      <div class="ui-block-a" style="width:60px;margin-top:7px">
        <p id="qi1"> 起送价 </p>
      </div>
      <div class="ui-block-b" style="width:50px;">
        <p >
          <input type="number" min="0" max="100" value="0" id="qisong1"/>
        </p>
      </div>
      <div class="ui-block-c" style="width:80px;margin-left:20px;;margin-top:7px">
        <p style="display:none" id="mian1"> 免送货费 </p>
      </div>
      <div class="ui-block-d" style="width:50px">
        <p>
          <input type="hidden" min="0" max="100" value="0" id="miansonghuo1"/>
        </p>
      </div>
    </div>
    <p align="center"><a class="ui-btn ui-corner-all ui-btn-inline" onClick="submit_Shipping()" style="text-align:center; background-color:#55c3f1">确定</a></p>
  </div>
</div>
<script type="text/javascript">

function change612(id){
var i =id.substring(id.length,id.length-1);
if($("#switch612"+i).val()=="selsonghuo612"){
	$("#qi"+i).html("送货费");
	$("#qisong"+i).attr("id","songhuo"+i);
	$("#miansonghuo"+i).attr("type","number");
	$("#mian"+i).css("display","block");
}else{
	$("#qi"+i).html("起送价");
	$("#songhuo"+i).attr("id","qisong"+i);
	$("#miansonghuo"+i).attr("type","hidden");
	$("#mian"+i).css("display","none");
}
$("#page_6_1_2 div").trigger("create");
}

function submit_Shipping(){
var len = window.maxDistance611;
var str="["
for(var i=1;i<=len;i++){
	if($("#switch612"+i).val()=="selsonghuo612"){
	var shippingPrice612 = $("#songhuo"+i).val();
	var freeShippingPrice612 = $("#miansonghuo"+i).val();
	str+='{"distance":'+i+',"shippingPrice":'+shippingPrice612+',"freeShippingPrice":'+freeShippingPrice612+'},';
	}else{
	var startPrice612 = $("#qisong"+i).val();
	str+='{"distance":'+i+',"startPrice":'+startPrice612+'},'
	}
}
str=str.substring(0,str.length-1);
str+="]";
JKjsonP({
		ws:"merchants/setShipping",
		parameter:{id:window.shopId,"shipping":str},
		sFunc:function(json){
			alert(json.msg);
			str="";
			$.mobile.changePage("#page_6_1",{transition: "slide"});
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});
}

</script> 
<!--<div data-role="page" id="page_6_1_5">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a>
    <h1>预计送达时间</h1>
  </div>
  <div data-role="content">
    <div style="margin-top:20px;" align="center" id="ipgp"> </div>
    <p style="text-align:center"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" href="javascript:DeliveryTime_submit();">确认</a> </p>
    <div data-role="popup" class="ui-content"  id="popup14" data-theme="b">
      <p></p>
    </div>
  </div>
</div>-->
<div data-role="page" id="page_6_1_4" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">系统设置</h1>
  </div>
  <div data-role="content">
    <ul data-role="listview" id="sub614ul">
    </ul>
    <p align="center"><a class="ui-btn ui-corner-all ui-btn-inline" onClick="submit614()" style="text-align:center; background-color:#55c3f1; color:#FFFFFF">确定</a></p>
  </div>
</div>
<script type="application/javascript">
function submit614(){
	var len = subId614arr.length;
	var str="[";
	//var json614;
	for(var i=0;i<len;i++){
		var id= subId614arr[i];
		var subId614= $("#subId614"+id).val();
		var vehicle614 = $("#vehicle614"+id).val();
		var maWeight614 = $("#maWeight614"+id).val();
		str += '{"id":'+id+',"vehicle":'+vehicle614+',"maxWeight":'+maWeight614+'},';
		//json614 = JSON.parse(str);
		//alert(json614);
		//sub614arr.push(json614);
		//str="";
		//sub614arr.push('{"id":'+id+',"vehicle":'+vehicle614+',"maxWeight":'+maWeight614+'}');
	}
	
	str=str.substring(0,str.length-1);
	str+="]";
	//var jsonarr = JSON.stringify(sub614arr);
	//alert(jsonarr);
	//var str = JSON.stringify(sub614arr);
	//var json614 =JSON.parse(str);
	JKjsonP({
		ws:"merchants/setVehicle",
		parameter:{"vehicles":str},
		sFunc:function(json){
			alert(json.msg);
			str="";
			$.mobile.changePage("#page_6_1",{transition: "slide"});
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});
	window.sub614arr=[];
}
</script>
<div data-role="page" id="page_6_1_6" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">系统设置</h1>
  </div>
  <div data-role="content">
    <p style="text-align: center"> 开业&nbsp;早上
      <select id="opentime616">
      <option value="0">0</option>
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5">5</option>
      <option value="6">6</option>
      <option value="7">7</option>
      <option value="8">8</option>
      <option value="9">9</option>
      <option value="10">10</option>
      <option value="11">11</option>
      <option value="12">12</option>
      <option value="13">13</option>
      <option value="14">14</option>
      <option value="15">15</option>
      <option value="16">16</option>
      <option value="17">17</option>
      <option value="18">18</option>
      <option value="19">19</option>
      <option value="20">20</option>
      <option value="21">21</option>
      <option value="22">22</option>
      <option value="23">23</option>
      <option value="24">24</option>
      </select>
    </p>
    
    <p style="text-align: center"> 结业&nbsp;晚上
                    <select id="closetime616">
      <option value="0">0</option>
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5">5</option>
      <option value="6">6</option>
      <option value="7">7</option>
      <option value="8">8</option>
      <option value="9">9</option>
      <option value="10">10</option>
      <option value="11">11</option>
      <option value="12">12</option>
      <option value="13">13</option>
      <option value="14">14</option>
      <option value="15">15</option>
      <option value="16">16</option>
      <option value="17">17</option>
      <option value="18">18</option>
      <option value="19">19</option>
      <option value="20">20</option>
      <option value="21">21</option>
      <option value="22">22</option>
      <option value="23">23</option>
      <option value="24">24</option>
      </select>
    </p>
    <p style="text-align: center"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" style="background-color:#52c6f7; color:#FFFFFF" onclick="ShopTime_submit();"> 确定</a></p>
  </div>
  <div data-role="popup" class="ui-content" id="popup17" data-theme="b">
    <p class="jkpopupp"> </p>
  </div>
</div>
<script type="text/javascript">
function ShopTime_submit(){ 
	 var opentime616 = $("#opentime616").val();
     var closetime616 = $("#closetime616").val();
		 	var txt = "";
		 if($("#opentime616").val()=="") {
			txt += "开门时间 ";
		 }
		 if($("#closetime616").val()=="") {
			txt += "关门时间 "; 
		 }
		  if(txt!="") {
			txt += "不能为空！";
			alert(txt);
			
		 }else{
	JKjsonP({
	ws:"merchants/setTime",
	parameter:{openTime:opentime616, closeTime:closetime616, id:window.shopId}, 
		sFunc:function(json){
			alert(json.msg);
			window.openTime616 = opentime616;
			window.closeTime616 = closetime616;
			window.maxDistance611 = storage.getItem("maxDistance");
		localStorage.setItem("openTime",opentime616);
		localStorage.setItem("closeTime",closetime616);
		$.mobile.changePage("#page_6_1",{transition:"slide"});
					},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
					
	});
		 }
}
</script>
<div data-role="page" id="page_6_1_7" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1>系统设置</h1>
  </div>
  <div data-role="content">
    <ul data-role="listview" id="sub617ul">
      <li data-role="list-divider" id="sub617">
        <div style="white-space:pre-wrap">配货端和送货端用户名及密码在紧急情况可用其他手机登录，如手机没电了</div>
      </li>
      <li><a onClick="go618(this.id)" id="1" data-transition="slide">
        <p><span id="name6171">mike</span><span> 权限:</span><span id="authority6171">配货端</span></p>
        <p><span >手机号：</span><span id="phone6171">13611111111</span></p>
        <p><span>密码：</span><span id="password6171">123456</span></p>
        </a></li>
      <li><a onClick="go618(this.id)" id="2" data-transition="slide">
        <p><span id="name6172">jimmy </span><span > 权限:</span><span id="authority6172">送货端</span></p>
        <p><span>手机号：</span><span id="phone6172">13622222222</span></p>
        <p><span>密码：</span><span id="password6172">654321</span></p>
        </a></li>
    </ul>
  </div>
</div>
<script type="text/javascript">
  function go618(id){
	  $("#page_6_1_8").page();
	  $("#in618").attr("checked",false);
	  $("#out618").attr("checked",false);
	  var name618 = $("#name617"+id).html();
	  var authority618=$("#authority617"+id).html();
	  if(authority618=="配货端"){
	$("#in618").attr("checked", "checked");
	$("#in618").prev("label").removeClass("ui-radio-off").addClass("ui-radio-on");
	$("#out618").prev("label").removeClass("ui-radio-on").addClass("ui-radio-off");
}else if((authority618=="送货端")){
	$("#out618").attr("checked", "checked");
	$("#in618").prev("label").removeClass("ui-radio-on").addClass("ui-radio-off");
	$("#out618").prev("label").removeClass("ui-radio-off").addClass("ui-radio-on");
}

	   
	  var phone618 = $("#phone617"+id).html();
	  var password618 = $("#password617"+id).html();
	  $("#name618").html(name618);
	  $("#authority618").html(authority618);
	  $("#phone618").html(phone618);
	  $("#password618").val(password618);
	  $("#delete6181").attr("onclick","delete618Sub("+id+");")
	  $("#change618").attr("onclick","change618Sub("+id+");")
	  $.mobile.changePage("#page_6_1_8",{transition: "slide"});
	  }
  </script>
<div data-role="page" id="page_6_1_8" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">系统设置</h1>
  </div>
  <div data-role="content">
    <fieldset data-role="controlgroup">
      <div class="ui-grid-a">
        <div class="ui-block-a">
          <label for="in618" style="border:none">配货端</label>
          <input type="radio" name="authority618" id="in618" value="1">
        </div>
        <div class="ui-block-b">
          <label for="out618" style="border:none">送货端</label>
          <input type="radio" name="authority618" id="out618" value="2">
        </div>
      </div>
    </fieldset>
    <div style="margin-top:50px">
      <p><span id="name618"> </span><span style="margin-left:10px">现有权限:</span><span id="authority618"></span></p>
      <p><span>手机号：</span><span id="phone618"></span></p>
      <div class="ui-grid-a">
        <div class="ui-block-a" style="width:30%;margin-top:15px"> <span>密码：</span> </div>
        <div class="ui-block-b" style="width:70%">
          <input type="text" id="password618">
        </div>
      </div>
    </div>
    <div class="ui-grid-a">
      <div class="ui-block-a"> <a class="ui-btn ui-corner-all" href="#page_6_1_8_1" data-rel="popup" data-position-to="window" style="background-color:#52c6f7; color:#FFFFFF" data-transition="pop">删除</a> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all" style="background-color:#52c6f7; color:#FFFFFF" id="change618" >修改</a> </div>
    </div>
  </div>
  <div  data-role="popup" id="page_6_1_8_1" >
    <p align="center">确定删除？</p>
    <div class="ui-grid-a">
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all" data-rel="back" data-icon="back" >返回</a> </div>
      <div class="ui-block-a"> <a class="ui-btn ui-corner-all" id="delete6181" >删除</a> </div>
    </div>
  </div>
</div>
<script type="text/javascript">
function delete618Sub(id){
	JKjsonP({
		ws:"merchants/delSubAdmin",
		parameter:{id:id},
		sFunc:function(json){
			alert(json.msg);
			if(json.result=="success"){
				go617();
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});
}

function change618Sub(id){
	var password618 = $("#password618").val();
	var authority618 = $("input[name='authority618']:checked").val();
					if(authority618=="1"){
						authority618="distribution";
					}else if(authority618=="2"){
						authority618 = "delivery";
						}
	if(password618==""){
		alert("密码不能为空");
		}else if(typeof($("input[name='authority618']:checked").val())=="undefined"){
			alert("权限不能为空");
		}else{
	 
	JKjsonP({
		ws:"merchants/updateSubAdmin",
		parameter:{id:id,authority:authority618,password:password618},
		sFunc:function(json){
			alert(json.msg);
			if(json.result=="success"){
				go617();
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	
	});
		}
}
</script>
<div data-role="page" id="page_6_2" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">商铺信息</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a">
      <div class="ui-block-a" >
        <p> 名称：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px">
        <p id="shopName62"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>编号：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px">
        <p id="code62"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>地址：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px">
        <p id="address62"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>手机号：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px">
        <p id="telephone62"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>使用到期时间：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px">
        <p id="lastTime62"></p>
      </div>
    </div>
    <div class="ui-grid-a">
      <div class="ui-block-a" >
        <p>外送销售额：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px"> </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>今日：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px">
        <p id="today62"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>本周：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px">
        <p id="thisWeek62"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>本月：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px">
        <p id="currentMonth62"></p>
      </div>
    </div>
    <div class="ui-grid-a" style="margin-top:-30px">
      <div class="ui-block-a" >
        <p>上月：</p>
      </div>
      <div class="ui-block-b" style="margin-left:-30px">
        <p id="lastMonth62"></p>
      </div>
    </div>
  </div>
</div>
<div data-role="page" id="page_6_3" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">申请店铺手机端</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a">
      <div class="ui-block-a">
        <input  name="authority63" type="radio" class="dw-i" id="in63" value="1" checked>
        <label for="in63"  style="border:none;">配货端</label>
      </div>
      <div class="ui-block-b">
        <input type="radio" name="authority63" id="out63" value="2">
        <label for="out63"  style="border:none">送货端</label>
      </div>
    </div>
    <div class="ui-field-contain" style="margin:0 0 0 0 ;">
      <h4>姓名/昵称：
        <input type="text"  id="name63" placeholder="姓名/昵称"  value="">
      </h4>
      <h4>新的手机号:
        <input type="text" id="phone_number63" placeholder="新的手机号"  value="">
      </h4>
      <h4>确认手机号：
        <input type="text"  id="rephone_number63" placeholder="确认手机号"  value="">
      </h4>
      <h4>设置密码：
        <input type="password" id="password63" placeholder="密码" value="">
      </h4>
      <h4>确认密码：
        <input type="password" id="repassword63" placeholder="确认密码" value="">
      </h4>
      <h4>输入验证码：
        <input type="text" id="auth_code63" placeholder="验证码" value="" style="width:150px;">
        <a style=" position: relative;top:-38px; left:170px;" onClick="getVcode63(this)"> 获取短信验证码</a></h4>
      <p align="center"><a class="ui-btn ui-corner-all ui-btn-inline" onClick="submit63()" style="text-align:center; background-color:#55c3f1">申请</a></p>
    </div>
  </div>
</div>
<script type="text/javascript">

function getVcode63(obj){
	var timeout = 60;
            var interValT;
	var tel = $("#phone_number63").val();
	if (tel == '') {
                    alert('请填写手机号');
                } else if (tel.match(/^1[3|4|5|7|8][0-9]\d{8}$/) == null) {
                    alert('请输入正确的手机号');
                } else {
					$(obj).attr("onClick","");
                   
                    interValT = setInterval(function() {
                        $(obj).html(timeout--+"秒后重新获取");
						if(timeout == 0){
							 window.clearInterval(interValT); 
							timeout = 60;
							 $(obj).html("获取短信验证码");
						$(obj).attr("onClick","getVcode63(this)");
						}
                    },
                    1000);
					
JKjsonP({
		ws:"merchants/sendSmsCode",
		parameter:{phoneNumber:tel},
		sFunc:function(json){
			if(json.result == "success"){
			}else{
				alert("短信发送时间，请稍后重试");
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});
}
}

function submit63(){
		var txt = "";
		if(typeof($("input[name='authority63']:checked").val())=="undefined"){
			txt += "子端权限 "
			}
		 if($("#name63").val()=="") {
			txt += "姓名/昵称 ";
		 }
		  if($("#phone_number63").val()==""||$("#rephone_number63").val=="") {
			txt += "手机号 ";
		 }
		 if($("#password63").val()=="" || $("#repassword63").val()=="") {
			txt += "密码 ";
		 }
		 if(txt!="") {
			txt += "不能为空！";
			alert(txt);
		 } else if(JKCheckMobileSet($("#phone_number63"),$("#rephone_number63"))){
				 if(JKCheckPasswordSet($("#password63"), $("#repassword63"))) {
					 var vcode = $("#auth_code63").val();
					var mobileno = $("#phone_number63").val();
					JKjsonP({
		ws:"merchants/validateSmsCode",
		parameter:{phoneNumber:mobileno,code:vcode},
		sFunc:function(json){
			if(json.result == "success"){

			        var name63 = $("#name63").val();
					var phone_number63 = $("#phone_number63").val();
					var password63 = $("#password63").val();
                    var authority = $("input[name='authority63']:checked").val();
					if(authority=="1"){
						authority="distribution";
					}else if(authority=="2"){
						authority = "delivery";
						}
				   JKjsonP({
					ws:"merchants/registerSub",
				parameter:{username:phone_number63, password:password63, authority:authority, nickName:name63,id:window.shopAdminId},
					sFunc:function(json){
							alert(json.msg);	
							if(json.result=="success"){
								 $.mobile.changePage("#page_6_1",{transition: "slide"});
								}					
					},
					eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
				});	
				}else{
				alert(json.msg);
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});				
			 }
	}
}

</script>
<div id="page_6_4" data-role="page" data-theme="jk">
  <div data-role="header"><a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back">返回</a> <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a>
    <h1 class="ui-corner-all">修改登录密码</h1>
  </div>
  <div data-role="content">
      <label for="password2">新的密码
        <input type="password" id="password64" placeholder="设置密码" value="">
      </label>
      <label for="repassword2">确认密码
        <input type="password" id="repassword64" placeholder="请再输入一次密码" value="">
      </label>
       <h4>输入验证码：
        <input type="text" id="auth_code" placeholder="验证码" value="" style="width:150px;">
        <a style=" position: relative;top:-38px; left:170px;" onClick="getVcode64(this)"> 获取短信验证码</a></h4>
      
    <p align="center"><a class="ui-btn ui-corner-all ui-btn-inline" onClick="resetPassword64()" style="background-color:#52c6f7; color:#FFFFFF; text-align:center">设置密码</a></p>
  </div>
</div>
<script type="text/javascript">
function getVcode64(obj){
	
	var timeout = 60;
            var interValT;
	var tel = window.storage.getItem("LoginName");
	if (tel == '') {
                    alert('请填写手机号');
                } else if (tel.match(/^1[3|4|5|7|8][0-9]\d{8}$/) == null) {
                    alert('请输入正确的手机号');
                } else {
                   $(obj).attr("onClick","");
                   
                    interValT = setInterval(function() {
                        $(obj).html(timeout--+"秒后重新获取");
						if(timeout == 0){
							 window.clearInterval(interValT); 
							timeout = 60;
							 $(obj).html("获取短信验证码");
						$(obj).attr("onClick","getVcode63(this)");
						}
                    },
                    1000);
JKjsonP({
		ws:"merchants/sendSmsCode",
		parameter:{phoneNumber:tel},
		sFunc:function(json){
			if(json.result == "success"){
				
			}else{
				alert("短信发送时间，请稍后重试");
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});
}

}
function resetPassword64(){
	var txt = "";
		 if($("#password64").val()=="") {
			txt += "密码 ";
		 }
		 if(txt!="") {
			txt += "不能为空！";
			//$("#afui").popup(txt); 
			alert(txt);
		 }
	if(JKCheckPasswordSet($("#password64"), $("#repassword64"))) {
		var vcode = $("#auth_code").val();
					
					var mobileno = window.storage.getItem("LoginName");
JKjsonP({
		ws:"merchants/validateSmsCode",
		parameter:{phoneNumber:mobileno,code:vcode},
		sFunc:function(json){
			if(json.result == "success"){

	var pwd = $("#password64").val();
	JKjsonP({
					ws:"merchants/resetPassword",
					parameter:{id:window.shopId, password:pwd},
					sFunc:function(json){
							alert(json.msg);
					},
					eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
				});	
			}else{
				alert(json.msg);
			}
		},
		eFunc:function(XMLHttpRequest, textStatus, emessage){
			alert(emessage);
		}
	});	

		}
	}
</script>
<div id="page_7_1" data-role="page" data-theme="jk">
  <div data-role="header">
    <h1 class="ui-corner-all">软件客服信息</h1>
    <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style="margin-right:33px">菜单</a> </div>
  <div data-role="content">
    <div class="ui-field-contain">
      <p>公司名称&nbsp &nbsp 上海景视信息科技有限公司</p>
      <p>联系电话&nbsp &nbsp 18621288541</p>
      <p>联系邮箱&nbsp &nbsp nciml_delivery@qq.com</p>
      <p>教程网站&nbsp &nbsp www.kaixinguo.mobi/help</p>
    </div>
  </div>
</div>
<div data-role="panel" id="leftpanel" data-position="right " data-display="reveal" data-theme="jk" style="border:none;">
  <ul >
    <li><a href="#page_3_1" data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_3_1');"  style="background-color:#54c3f1; color:#FFFFFF">订单管理</a></li>
    <li><a href="#page_1_2_3" data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_1_2_3');"  style="background-color:#54c3f1; color:#FFFFFF">送货状态</a></li>
    <li><a href="#page_4_1_1" data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_4_1_1');"  style="background-color:#54c3f1; color:#FFFFFF">新品快速上架向导</a></li>
    <li><a href="#page_5_1_1" data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_5_1_1');"  style="background-color:#54c3f1; color:#FFFFFF">快速修改水果价格</a></li>
    <li><a href="#page_5_2_1" data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_5_2_1');"  style="background-color:#54c3f1;  color:#FFFFFF">水果管理</a></li>
    <li><a href="#page_6_1" data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_6_1');"  style="background-color:#54c3f1;  color:#FFFFFF">系统设置</a></li>
    <li><a href="#page_7_1" data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_7_1');"  style="background-color:#54c3f1;  color:#FFFFFF">软件客服信息</a></li>
    <li><a  class="ui-btn"  style="background-color:#54c3f1;color:#FFFFFF" onClick="reLogin()">退出</a></li>
  </ul>
</div>
<script>
function clean411(){
	$("#fruitpice43ge").val("");
	$("#fruitpice43jin").val("");
	$("#fruitpice43yuan").val("");
	$("#fruitpice43njin").val("");
	$("#day").val("个");
	$('#day').selectmenu();
	$('#day').selectmenu('refresh', true);
	$('#new').checkboxradio();
	$('#import').checkboxradio();
	$('#new').attr('checked',false).checkboxradio("refresh"); 
	$('#import').attr('checked',false).checkboxradio("refresh"); 
	$("#infruitName411").val("");
	$("#className").html("");
	$("#fruitName411").html("");
	$("#fruitInfo").val("");
}
function panel(){
	if($("#leftpanel").open){
		$( "#leftpanel" ).panel( "close" );
	}else{
	$( "#leftpanel" ).panel( "open" );
	}
}
	function reLogin(){
		localStorage.clear();
		localStorage.setItem("telPhones",window.telArr);
		if("undefined" != typeof (mobile)){
			mobile.logout();
		}
		top.location="index.html";
	
	}
	
	
	var currentPageID = "#page_3_1";
	$(function() {
		$(document).on("swipeleft", function(event){
			$( "#leftpanel" ).panel( "open" );
		});
		$(document).on("swiperight", function(event){
			$( "#leftpanel" ).panel( "close" );
		});
	});
	function samePageID(newPageID){
		if(newPageID == "#page_4_1_1"){
		clean411();
		}
		if(newPageID == "#page_3_1"){
		getTodayOrder();
		}
		if(newPageID=="#page_5_1_1"){
			$("#fruitList li").remove();
		listFruitList("511");
		}
		if(newPageID=="#page_5_2_1"){
			$("#fruitList522 li").remove();
		listFruitList("521");
		}
		if(currentPageID == newPageID) {
			$(":jqmData(role='panel')").panel('close');
		}else{
			currentPageID = newPageID;
		}
	};
</script> 
<script id="panel-init">
		$(function() {
			$( "body>[data-role='panel']" ).panel();
		});
	</script>
</body>
</html>
